Replace Constructor with Factory Method
From CSSEMediaWiki
Revision as of 00:06, 15 October 2009 by Matthew Harward (Talk | contribs)
When constructing a complex object or complex sets of objects, a Factory Method may be preferable to a Constructor when creating new objects. This is particularly useful in the case of an inheritance hierarchy where the higher classes and other system classes should not have knowledge of which type of object to create.
See Also