Currently the FormComposite holds an array of validation strategies (ValidateInterface) and loops through them during validation. This is somewhat confusing, making it unclear that a strategy pattern is being used. It also add's too much responsibility to the FormComposite.
The new Validator class will be added to the FormComposite as a class member, and the FormComposite will feed it a single strategy at a time.
The only validation responsibility the FormComposite should have is providing correct strategies to the Validator
Currently the FormComposite holds an array of validation strategies (ValidateInterface) and loops through them during validation. This is somewhat confusing, making it unclear that a strategy pattern is being used. It also add's too much responsibility to the FormComposite.
The new Validator class will be added to the FormComposite as a class member, and the FormComposite will feed it a single strategy at a time.
The only validation responsibility the FormComposite should have is providing correct strategies to the Validator