jeudi 21 janvier 2016

Which design pattern to use for my use case?

I have a use case where the input is set of parameters (say A, B, C, D) and data (say XYZ). Based on the parameters(A,B,C,D) i have to process the data(XYZ) and respond back. The processing logic can be unique or common based on parameters(say do something#1 only when A, do something#2 when A and C, do something#2 when B, C and D and so on). I might also need to maintain the order of processing.

The current implementation is based on if-else loops. I am looking at chain of responsibility, pipeline design patterns. But is there any other suitable design pattern for the above task ?

Aucun commentaire:

Enregistrer un commentaire