Replace Constructor with Factory Method
From CSSEMediaWiki
(Difference between revisions)
(New page: When constructing a complex object or complex sets of objects, a Factory Method may be preferable to a Constructor when creating new objects. == See Also == {{Refactoring}}) |
m (Reverted edits by Ebybymic (Talk); changed back to last version by Matthew Harward) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | When constructing a complex object or complex sets of objects, a [[Factory Method]] may be preferable to a [[Constructor]] when creating new objects. | + | 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 == | == See Also == | ||
{{Refactoring}} | {{Refactoring}} |
Latest revision as of 03:23, 25 November 2010
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