Abstract Factory Pattern

Slides:



Advertisements
Similar presentations
Creational Design Patterns. Creational DP: Abstracts the instantiation process Helps make a system independent of how objects are created, composed, represented.
Advertisements

Creational Patterns, Abstract Factory, Builder Billy Bennett June 11, 2009.
Factory Pattern Building Complex Objects. New is an implementation  Calling “new” is certainly coding to an implementation  In fact, it’s always related.
More Interfaces, Dynamic Binding, and Polymorphism Kirk Scott.
 Consists of Creational patterns  Each generator pattern has a Client, Product, and Generator.  The Generator needs at least one operation that creates.
Informatics 122 Software Design II Lecture 5 Emily Navarro Duplication of course material for any commercial purpose without the explicit written permission.
Brittany Johnson CSCI360 Abstract Factory Design Pattern.
Feb Ron McFadyen1 Factory Method Iterator Example : Java collection classes represent an example of the Factory Method design pattern. The.
Prototype Pattern Creational Pattern Specify the kinds of objects to create using a prototypical instance, and create new objects by copy this prototype.
Design Pattern Course Builder Pattern 1 Mahdieh Monzavi AmirKabir University of Technology, Department of Computer Engineering & Information Technology.
Feb Ron McFadyen1 Adapter An adapter converts the interface of a class into another interface the client expects. An adapter lets classes work.
CS 4233 : Object-Oriented Analysis and Design Concrete Factory Abstract Factory.
Design Patterns Based on Design Patterns. Elements of Reusable Object-Oriented Software. by E.Gamma, R. Helm, R. Johnson,J. Vlissides.
Design Pattern – Bridge (Structural) References Yih-shoung Chen, Department of Information Engineering, Feng Chia University,Taiwan, R.O.C. The Bridge.
ECE 355 Design Patterns Tutorial Part 2 (based on slides by Ali Razavi) Presented by Igor Ivković
+ Informatics 122 Software Design II Lecture 8 Emily Navarro Duplication of course material for any commercial purpose without the explicit written permission.
Linzhang Wang Dept. of Computer Sci&Tech, Nanjing University The Abstract Factory Pattern.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. The Factory Method Design Pattern (1) –A creational design.
Design Patterns.
Case Studies on Design Patterns Design Refinements Examples.
Abstract Factory Design Pattern making abstract things.
Design Pattern. The Observer Pattern The Observer Pattern defines a one-to-many dependency between objects so that when one object changes state, all.
Tech Talk Go4 Factory Patterns Presented By: Matt Wilson.
Class Relationships Lecture Oo10 Dependencies. References n Booch, et al, The Unified Modeling Language User Guide, Chapt 5 p.69, Chapt 9 130, Chapt 10.
Patterns and Reuse. Patterns Reuse of Analysis and Design.
Abstract Factory Abstract Factory using Factory Method.
Factory Patterns. RHS – SOC 2 Being less concrete One important OO principle is: ”Program to an interface, not an implementation” Interfaces reduces the.
The Factory Patterns SE-2811 Dr. Mark L. Hornick 1.
Design Patterns CS 124 Reference: Gamma et al (“Gang-of-4”), Design Patterns.
Excellence is a Habit Feb Lecture 14 We are what we repeatedly do. Excellence, then, is not an act, but a habit.” - Aristotle.
CS 210 Review Session October 5 th, Head First Design Patterns Chapter 4 Factory Pattern.
Factory Method Chris Colasuonno Also known as “Virtual Constructor”
The Factory Method Design Pattern Motivation: Class / Type separation – Abstract class serves as type definition and concrete class provides implementation.
Abstract Factory and Factory Method CS 124 Reference: Gamma et al (“Gang-of-4”), Design Patterns.
Factory Method Explained. Intent  Define an interface for creating an object, but let subclasses decide which class to instantiate.  Factory Method.
CSC 313 – Advanced Programming Topics. What Is the Factory Method?  Creation details hidden by AbstractCreator  Does effective job of limiting concrete.
Concrete Architecture of Mozilla Firefox (version ) Iris Lai Jared Haines John,Chun-Hung,Chiu Josh Fairhead July 06, 2007.
FacadeDesign Pattern Provide a unified interface to a set of interfaces in a subsystem. Defines a high level interface that makes the subsystem easier.
ANU COMP2110 Software Design in 2004 Lecture 17Slide 1 COMP2110 in 2004 Software Design Lecture 17: Software design patterns (4) 1The Abstract Factory.
SATMathVideos.Net A set S consists of all multiples of 4. Which of the following sets are contained within set S? A) S2 only B) S4 only C) S2 and S4 D)
The Factory Pattern Sanjay Yadav (ISE ).
CSC 480 Software Engineering Design With Patterns.
CSC 480 Software Engineering Lab 5 – Abstract Factory Pattern Oct 30, 2002.
Example to motivate discussion We have two lists (of menu items) one implemented using ArrayList and another using Arrays. How does one work with these.
The Abstract Factory Pattern (Creational) ©SoftMoore ConsultingSlide 1.
S.Ducasse Stéphane Ducasse 1 Abstract Factory.
Design Patterns Creational Patterns. Abstract the instantiation process Help make the system independent of how its objects are created, composed and.
Abstract Factory Pattern Jiaxin Wang CSPP Winter 2010.
Abstract Factory pattern Intent Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
SE 461 Software Patterns. ABSTRACT FACTORY PATTERN.
SE 461 Software Patterns. FACTORY METHOD PATTERN.
Factory Method Pattern. Admin SCPI Patner Day Feb. 21 Lunch count Presentation (4-8 min.) Practice on Feb. 16. Morning availablity on Feb21 Brief overview.
Abstract Factory Pattern
Factory Patterns 1.
Software Design and Architecture
Abstract Factory Pattern
Intent (Thanks to Jim Fawcett for the slides)
Presented by Igor Ivković
ABSTRACT FACTORY.
Design Patterns - A few examples
Programming Design Patterns
Design Pattern: Visitor
Object Oriented Design Patterns - Creational Patterns
Ms Munawar Khatoon IV Year I Sem Computer Science Engineering
Adapter Design Pattern
Creational Patterns.
Presented by Igor Ivković
CSC 480 Software Engineering
Visitor Pattern Intent
Presentation transcript:

Abstract Factory Pattern

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.

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

Ingredient Factory

Implement Ingredient Factory

Rework the Pizza

A Concrete Pizza

Revisit PizzaStore

Abstract Factory

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

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