Skip to main content

Posts

Showing posts with the label factory method

Creational Patterns : Factory Method

Properties: -            The same with factory pattern except that  Factory class is abstract class  and  createXYZ method is made abstract . -            Subclasses  of the factory class implements  createXYZ  method thus subclass determines how instance is created. -            Identified by  abstract Factory class and abstract creation method . Implementation: -            Factory class has an  abstract  method named  createXYZ  which takes necessary arguments. -            Abstract   createXYZ  method is implemented by subclasses of Factory class. A  Subclass  creates an appropriate  concrete   XYZ  instance and retuns. - ...