views:

46

answers:

0

I was reading the example in this: http://en.wikipedia.org/wiki/Specification_pattern and it seems an interesting pattern. The example can be applied as it is, if the different Specs did not share state or pass on information from one to another.

What if each produces some information apart from making the decision that can be reused by other in making this decision?

Also, it seems like to use this design pattern, it is necessary to have an idea of the entire decision tree. If we are not sure about the decision logic and if the project is iterative/exploratory in nature, depending on the success of the project, then would it be useful to use this pattern or just simply write code as a bunch of if-else's everywhere.

Also, how useful do you think this pattern is, if only 1 person is going to write that entire business logic and the business logic itself is only max 1000 lines long if written as bunch of if-else statements will common business logic combined in functions? Is this pattern useful only if many people are simultaneously going to work on it?

Thanks