Presentation is loading. Please wait.

Presentation is loading. Please wait.

Abstract Factory Pattern

Similar presentations


Presentation on theme: "Abstract Factory Pattern"— Presentation transcript:

1 Abstract Factory Pattern

2 Abstract Factory Pattern
Intent Provide an interface for creating families of related or dependent objects without specifying their concrete classes. Also known as “Kit” Motivating example A UI toolkit wants to support multiple looks and feels for their widgets, and need to create UI widgets of consistent look.

3 Back to PizzaStore For pizzas of different regions, the same ingredients are made differently. NY pizza should use NY style ingredients

4 Ingredient Factory

5 Implement Ingredient Factory

6 Rework the Pizza

7 A Concrete Pizza

8 Revisit PizzaStore

9 Abstract Factory

10 Note Abstract Factory pattern uses Factory Method pattern to create concrete product Abstract Factory create families of products that belong together When product need to be added or removed, the factory interface needs to be changed

11 Dependency Inversion Principle
Depend on abstraction, do not depend on concrete classes.


Download ppt "Abstract Factory Pattern"

Similar presentations


Ads by Google