Factory design pattern
Upcoming SlideShare
Loading in...5
×
 

Factory design pattern

on

  • 1,846 views

 

Statistics

Views

Total Views
1,846
Views on SlideShare
1,846
Embed Views
0

Actions

Likes
0
Downloads
8
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Factory design pattern Factory design pattern Presentation Transcript

  • Factory Design Patterns Farhad Safarov
  • Real World Examples:• The Bank• The Library
  • 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
  • UML
  • PHP example:
  • Symfony2• Services• http://api.symfony.com/2.0/Symfony/Bundle/ SecurityBundle/DependencyInjection/Security /Factory/SecurityFactoryInterface.html
  • Abstract Factory
  • The End• Any questions?
  • 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