Correctly Naming Patterns

JB and I were discussing some of the patterns we were using on our current project today while working on merging some of our disparate (but completely related) code. I had created several classes named XyzBuilder with the intention of actually following the Builder pattern. My final classes are really just Strategies, but I never changed the name (though I’ve meant to do so).

This hasn’t lead to confusion, however, as (a) the “builder” is in fact “building” an object for me so the name is still meaningful and (b) most of my team members aren’t that familiar with using patterns on a daily basis (or they at least say they don’t). I’ve a thought, though, that objects with pattern-ish names should be renamed to either non-pattern names or the name of the pattern they use.

Should the name match the pattern or does it really matter?

Advertisements