Factory design pattern

1,824 views
1,685 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,824
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
16
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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• http://api.symfony.com/2.0/Symfony/Bundle/ SecurityBundle/DependencyInjection/Security /Factory/SecurityFactoryInterface.html
  7. 7. Abstract Factory
  8. 8. The End• Any questions?
  9. 9. References:• http://www.oodesign.com/factory-pattern.html• http://www.itec.uni-klu.ac.at/~harald/ds2001/rmi/factory/factory2.html• http://en.wikipedia.org/wiki/Factory_method_pattern

×