I have a coding scenario, where I need to validate some inputs based on some rules. For eg the rules may look like
- Whether the user belongs to a particular country ?
- Whether user is allowed this particular event ?
- User didn't claim similar events in last 30 days ?
etc.
I am coding it in java. All of the rules return true or false and all rules needs to be validated. If any of the rules are failed, return false immediately without proceeding to validate other rules.
Which design pattern should be best for this kind of scenario ?
Aucun commentaire:
Enregistrer un commentaire