Skip to main content

Posts

Showing posts with the label simple factory

Creational Patterns : Simple Factory

Properties: -            Hides details of class instance creation and actual class implementation. This allows easy replacement of class implementation and gives flexibility to change the way new instance construction  is done. -            Creates and  abstraction  layer between client code and object needs to be created, thus facilitates  loose coupling . -            Client provides attributes of the object it needs to create and defers instantion to factory. It is not obligatory to supply any attributes though. -            Factory creates a suitable class instance according to attributes supplied.  -            The problem with Factory pattern is when a new implementation is added Factory class ...