Intent: Defines an interface for creating an object, but lets subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses. Also Known As: Virtual Constructor Motivation: Take into consideration a framework for desktop applications. Such applications are meant to work with documents. A framework for desktop applications contains definitions for operations such as opening, creating and saving a document. The basic classes are abstract ones, named Application and Document, their clients having to create subclasses from them in order to define their own applications. For generating a drawing application, for example, they need
The post What is factory method pattern appeared first on Coding Security.
What is factory method pattern
read more
Tidak ada komentar:
Posting Komentar