Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Factory design pattern


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Factory design pattern

  1. 1. Factory Design Patterns Farhad Safarov
  2. 2. Real World Examples:• The Bank• The Library
  3. 3. Advantages:• creates objects without exposing the instantiation logic to the client $obj = new ClassA(new ClassB, new Class C);• It is possible to use inheritance to easily edit how the class is created and put in a different set of classes
  4. 4. UML
  5. 5. PHP example:
  6. 6. Symfony2• Services• SecurityBundle/DependencyInjection/Security /Factory/SecurityFactoryInterface.html
  7. 7. Abstract Factory
  8. 8. The End• Any questions?
  9. 9. References:•••