I have list of objects in database now they are filtered at various steps depends of conditions and then finally select one object from the list and return. Here are Steps
- Get a list of objects based on input request from database
- Filter some objects based on business rules
- Call external HTTP services for each object and set properties of object based on response
- Filter the list based on properties set in step 3 and business rules
- Call external another HTTP services for each list from step 4 and set properties of object based on response
- Get one object base on populated list in step 5 and business rules
Now based on input we don't require some steps like if input value is "1" do step 1,5,6 like if input value is "2" do step 1,2,3,4,5,6 like if input value is "3" do step 1,2,5,6 etc
Which patter should i use here
Aucun commentaire:
Enregistrer un commentaire