views:

355

answers:

2

From my reading, it appears that the Specification Pattern can greatly reduce the reduce the number of methods needed to filter data. What benefits have you seen using the Specification Pattern? Were there unforeseen benefits that you noticed. conversely, what pitfalls did you encounter?

+2  A: 

It doesn't reduce complexity so much as it makes it more familiar and navigational. If you already understand the pattern, examining code, even highly complex code, becomes more manageable because you can see the pattern. Liken it to a small town that uses lettered streets for north/south and numbered streets for east/west. Likely you will be able to find stuff even if you have never been there before, because you understand the pattern.

dacracot
Familiar in what way?
David Robbins
+2  A: 

When working in large projects, you will most certainly find usage of the specification pattern to be hot-spots for performance problems. This is because of their simplicity and elegance, people compose them in all sorts of manners not conceived by the original author, and re-use in different contexts.

These problems are normally easy to fix, and even though I use the word "problem" it's kind of a good thing; you dont fix these things before they turn out to be a problem.

krosenvold
Thanks for the insight. How do you go about maintaining the new specifications - different assemblies?
David Robbins