Designing a problem solution
Hi All I have total 5 different work flows. Those are almost simillar apart from few conditions. For example, Workflow names are A, B, C, D and E. All are doing 3 tasks like Task T1, Task T2 and Task 3. Almost 90% code is common for all 5 workflows. Below is just overview of current implmentation [All workflow follows / call a single method called PerformWorkflow]: PerformWorkflow(): DoTaskT1: Common Code 1 if Workflow A , Follow values as xyz Common Code 2 with above values DoTaskT2: Common Code 3 if Workflow A , Follow values as xyz if Workflow B , Follow values as abc rest all Workflow , Follow values as xyz Common Code 4 with above values DoTaskT3: Common Code 5 if Workflow C , Follow values as xyz if Workflow D , Follow values as abc rest all Workflow, Follow values as xyz Common Code 6 with above values I feel that this is not a rigt way to do as all workflow has same method and it violates Single Responsibility principle... Is this observation correct? What should be ideal way to design this system?