mardi 19 janvier 2021

Which Design Pattern to Use to fit the below scenario [closed]

I have a coding scenario, where I need to validate some inputs based on some rules. For eg the rules may look like

  1. Whether the user belongs to a particular country ?
  2. Whether user is allowed this particular event ?
  3. 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