Design patterns are about how something does it’s job, rather than why. Using a design pattern name in the name of a class makes it quite fragile. For example, if you have called all your classes BlahBlahState
, then refactoring to a Strategy
is quite invasive, but if it’s phrased in terms of the why, then the names don’t need to change.
A good analogy here is the relation of unit tests to implementation; you should be able to change the internal implementation of the class without changing the tests. If you can’t, then the tests are too brittle. Likewise, you should be able to change the implementation without changing the class name; if your class name is tied to the implementation, through the pattern name, then it’s too brittle.