Wednesday, October 4, 2017

Abstract Factory Pattern


When the request reaches the code responsible for creating objects. It will call the abstract factory. Then the abstract factory will call the appropriate factory (here Factory I) responsible for creating objects. Then the factory will call car creator and cycle creator respectively. They will create the car and cycle and  If required as shown in picture it is connecting to database for each units and assemble it and return it to the requested person.

Notes
  •  The original requester does not know which factory the abstract factory is going to call they are only in contact with abstract factory If tomorrow the abstract factory changes its factory or factory changes its object creators it will not affect the original requester.
  • Original requester requests for more than one type of related or depended objects (here car and cycle). 
check here for grafffitoid version of other design patterns

No comments:

Post a Comment