mercredi 5 mai 2021

Design pattern for separation of concerns

I've am looking for a design pattern to provide separation of concerns and keep the my operations segregated.

In my application I'm getting say 1000 requests, which needs to perform one of 3 given operations, namely, Op1, Op2, Op3.

Each operation have two or three sub-tasks.

Op1 -> Add, Remove
Op2 -> Add, Remove
Op3 -> Add, Remove, Update

enter image description here

I've these 1000 requests beforehand, so it is not like they are coming one by one.

Also these requests themselves mentions which specific Task & Sub-task needs to be performed.

Before assigning request to any operation, there is a validation that needs to be done on these requests.

Then based on the requested operation, Op1/Op2/Op3 & corresponding sub-task should be performed.

Initially I thought to use Command Design Pattern but since I've multi-level of tasks, I'm don't think it is the best approach.

Please suggest.

Aucun commentaire:

Enregistrer un commentaire