I recently stumbled across an older article from Greg Young about something called the Specification Pattern. I haven’t heard about it before but the problem sounds familiar to me as I already implemented something similar.
Digging deeper I found an interesting paper from Eric Evans and Martin Fowler explaining the idea in depth: Specifications.
There is also a small Java implementation of the pattern available at Google Code that unforunately seems to be inactive since 2008.
Advertisement