Factory method

  • View
    403

  • Download
    0

Embed Size (px)

Transcript

  • 1. Factory Method 13.03.09

2. FactoryMethod ? FactoryMethod 3. Factory Method Abstract Factory Builder Prototype Singleton 4. Factory Method Abstract Factory Builder Prototype Singleton 5. Factory Method 6. ? . 7. ? . 8. ? MallardDuckDecoyDuck .(new ) 9. ? .. 10. ? 11. ? , , 12. Factory , 13. ? , ,, . 14. ? 15. ? . 16. ?NYCA 17. ? ,1. , .2. , .. 18. ? ... 19. ? ,NY orderPizzaCA 20. ? NY orderPizzaCA 21. ?NYCA 22. Factory Method . , . 23. Factory Method Factory Method. 24. Factory Method 25. Factory Method . .. 26. Factory Method , . 27. Factory MethodFactoryMethod , . 28. Factory Method , PizzaStore NYCheeseNYPepperoniCACheese CAPepperoni 29. Factory MethodPizzaStore , .Pizza NYCheeseNYPepperoni CACheese CAPepperoni 30. Factory Method PizzaStore , SimpleFactory , . PizzaNYCheeseNYPepperoni CACheese CAPepperoni 31. Factory Method (DIP : Dependency Inversion Principle) . 32. Factory MethodPizza ( . ) PizzaStoreNYCheeseNYPepperoniCACheese CAPepperoni 33. Factory MethodPizzaStore ( Pizza .) Pizza PizzaStore . . inversion PizzaStore Pizza NYCheese NYPepperoniCACheese CAPepperoni 34. Factory Method Ogre MovableObject Movable, Node attach . , , , Movable , . 35. Factory Method , , . 36. Factory Method createInstanceImpl . 37. Factory Method Light , 38. Factory Method Entity (Ogre ) 39. Factory Method . 40. Factory Method 41. Factory Method , . , . 42. Factory Method , . 43. Factory Method , . 44. Factory Method MovableObject MovableObjectFactory . 45. Factory Method Ogre . , . ( Ogre , .) 46. Factory Method / , . Ogre Ogre ,Ogre MovableObject . 47. Factory Method 48. Factory Method , Abstract Factory . 49. Head First Ogre