The Factory Method Pattern

The Factory Method is a pattern intended to help assign responsibility for creation. According to the Gang of Four, the intent of the Factory Method is to

Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.[1]

[1] Gamma, E., Helm, R., Johnson, R., Vlissides, J., Design Patterns: Elements of Reusable Object-Oriented Software, Reading, Mass.: Addison-Wesley, 1995, p. 325.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset