Specification is a tactical design pattern presented in Erics Evans’ book Domain-Driven Design. It can be used not only when new code is written, but also as a power tool for refactoring work. Patrik Fredriksson shows us how to use the Specification pattern to transform a piece of ugly code into a creation of beauty.
![](https://www.citerus.se/wp-content/uploads/2019/07/specifications_2.png)