Published July 30, 2019
by Doug Klugh

Quick & Dirty Factories

Define an interface for creating objects so that the instantiation of new objects is delegated to methods within the implementing class.  This will decouple application-specific classes from your code and enable those factory methods to provide extended versions of objects.  Unlike the Abstract Factory Pattern, it is not necessary to instantiate separate factory classes.  The downside is you're stuck with just one type of factory and you cannot change it at runtime.