Background:
I have a rough, but working understanding of ~15 design patterns. It's been my experience using design patterns in my own projects that the resulting implementations usually end up as some variant of a pattern and don't always fit the canonical textbook examples.
Case:
I find it useful to leave tag-like comments that hint at an underlying archetype, e.g., in the following Javadoc class description, the "[Singleton]" label is used merely to describe that there's only one of these objects used at any given time. This class may or may not be set up to "restrict the instantiation of a class to one object" --Wikipedia.
/** * [Singleton] * The manager of all jewels, which are stored here in collections. */ public class JewelManager implements IDestroyable { Context:
I'm working on a team with several other developers, but I need to assume there may be other devs working on the project with whom I will never have the opportunity to speak.
Question:
Is it misleading to label classes or methods as a particular design pattern (Strategy, Mediator, etc.) if they only loosely fit that definition?