Basic Customization > User Interface Customization > Presenting Information in the UI > UI Validation > Solutions > Miscellaneous Tips, Tricks, and Things to Avoid > Rule of Thumb: One Validator per Action/Attribute/Component
  
Rule of Thumb: One Validator per Action/Attribute/Component
Don’t fall into the trap of having one validator registered for multiple unrelated actions. The result is lots of if/else branching and some very large methods. This can make maintenance difficult, and makes it much easier to introduce regressions.
In general, the only times where you would use a single validator for multiple actions/components would be if those components share the exact same validation logic, or if you have an either/or scenario. What we mean by an either-or scenario is that in a given action menu, either actionA or actionB should appear, but never both. For all other cases, the best practice is to register one validator per action/component.