Abstract Factory Design Pattern making abstract things.

Slides:



Advertisements
Similar presentations
Creational Patterns, Abstract Factory, Builder Billy Bennett June 11, 2009.
Advertisements

© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Generator Design Patterns: The Factory Patterns.
ITEC200 – Week03 Inheritance and Class Hierarchies.
. Plab – Tirgul 12 Design Patterns. Design Patterns u The De-Facto Book on Design Patterns:
Design Pattern Course Builder Pattern 1 Mahdieh Monzavi AmirKabir University of Technology, Department of Computer Engineering & Information Technology.
Prototype Creational Design Pattern By Brian Cavanaugh September 22, 2003 Software, Design and Documentation.
ECE 355 Design Patterns Tutorial Part 2 (based on slides by Ali Razavi) Presented by Igor Ivković
Design Patterns academy.zariba.com 1. Lecture Content 1.What are Design Patterns? 2.Creational 3.Structural 4.Behavioral 5.Architectural 6.Design Patterns.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Pattern Abstract Factory
Creational Patterns Making Objects The Smart Way Brent Ramerth Abstract Factory, Builder.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. The Factory Method Design Pattern (1) –A creational design.
Singleton Christopher Chiaverini Software Design & Documentation September 18, 2003.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
CISC6795: Spring Object-Oriented Programming: Polymorphism.
Case Studies on Design Patterns Design Refinements Examples.
What is “model transformation”? Distinction between source and target Source may be same as target May be multiple sources, or targets Reaching a fixed.
Factory Method A Creational Design Pattern. Factory Method Key Features  Defines an interface for creating objects without needing to know each object’s.
Design Pattern. The Observer Pattern The Observer Pattern defines a one-to-many dependency between objects so that when one object changes state, all.
Software Components Creational Patterns.
Dependency Injection Technion – Institute of Technology Author: Gal Lalouche - Technion 2015 ©
The Factory Patterns SE-2811 Dr. Mark L. Hornick 1.
Architectural pattern: Interceptor Source: POSA II pp 109 – 140POSA II Environment: developing frameworks that can be extended transparently Recurring.
Design Patterns Gang Qian Department of Computer Science University of Central Oklahoma.
Design Patterns CS 124 Reference: Gamma et al (“Gang-of-4”), Design Patterns.
Unit 4 Object-Oriented Design Patterns NameStudent Number CAI XIANGHT082182A KYAW THU LINHT082238Y LI PENGFEIHT082220L NAUNG NAUNG LATTHT082195L PLATHOTTAM.
Alternative Architectures: Inversion of Control Mike Hadlow mikehadlow.blogspot.com.
Define an interface for creating an object, but let subclasses decide which class to instantiate Factory Method Pattern.
CDP-1 9. Creational Pattern. CDP-2 Creational Patterns Abstracts instantiation process Makes system independent of how its objects are –created –composed.
Creational Patterns
Creational Pattern: Factory Method At times, a framework is needed to standardize the behavior of objects that are used in a range of applications, while.
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 13 Creational Design Pattern SWE 316: Software Design and Architecture.
DESIGN PATTERNS Sanjeeb Kumar Nanda 30-Aug What is a pattern? Pattern is a recurring solution to a standard problem Each Pattern describes a problem.
Introducing Allors Applications, Tools & Platform.
CS212: Object Oriented Analysis and Design Lecture 17: Virtual Functions.
Builder An Object Creational Pattern Tim Rice CSPP51023 March 2, 2010.
Design Patterns By Mareck Kortylevitch and Piotreck Ratchinsky.
ANU COMP2110 Software Design in 2004 Lecture 17Slide 1 COMP2110 in 2004 Software Design Lecture 17: Software design patterns (4) 1The Abstract Factory.
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
CS212: Object Oriented Analysis and Design Lecture 38: Design Pattern-II.
OOP Review CS 124.
Advanced Object-oriented Design Patterns Creational Design Patterns.
Chapter 7 Creational Design Pattern. Process Phases Discussed in This Chapter Requirements Analysis Design Implementation ArchitectureFrameworkDetailed.
Presented by Ted Higgins, SQL Server DBA An Introduction to Object – Oriented Programming.
Singleton Pattern. Problem Want to ensure a single instance of a class, shared by all uses throughout a program Context Need to address initialization.
Overview of Creational Patterns ©SoftMoore ConsultingSlide 1.
// create some behaviors SwimBehavior csb = new CircularSwimming(); QuackBehavior sqb = new StandardQuacking(); SwimBehavior rsb = new RandomFloating();
The State Design Pattern A behavioral design pattern. Shivraj Persaud
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.
1 Design Patterns prepared for COMP314, Bernhard Pfahringer see links on the web page as well!
Factory Method. Intent/Purpose Factory Method is used to deal with a problem of creating objects without specifying the EXACT class of object that we.
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
Unit II-Chapter No. : 5- design Patterns
Low Budget Productions, LLC
Week 2, Day 1: The Factory Method Pattern
Factory Patterns 1.
Prototype Design Pattern
Software Design and Architecture
Object-Oriented Programming
Abstract Factory Pattern
Intent (Thanks to Jim Fawcett for the slides)
Presented by Igor Ivković
Ms Munawar Khatoon IV Year I Sem Computer Science Engineering
Lesson 5: More on Creational Patterns
Designing For Testability
Presented by Igor Ivković
Jim Fawcett CSE687 – Object Oriented Design Spring 2014
Presentation transcript:

Abstract Factory Design Pattern making abstract things

Abstract vs. Concrete a number of design patterns use abstract and concrete classes –abstract class – provides a list of abstract functions to be used by the pattern –concrete class – provides implementation for the abstract functions abstract class pointers may point to concrete class objects and the abstract functions are overridden by concrete implementations –clients may not be concerned with implementations –various concrete objects may be assembled into a single container and operated uniformly virtual functions would provide customized functionality per object 2

Factory and Factory Methods factory – an object for creating other objects called products –important when control over object creation is necessary: e.g. instead of just creating an object, factory may dynamically allocate it from an object pool, do complex configurations –contains methods for object creation factory method (design pattern)- implements the actual object creation –usually returns a pointer to created object –specifies interface to be implemented (overridden) by sublcasses, hence known as virtual constructor why not regular constructor? cannot be overridden –example of behavior pattern singleton class is an example of a factory, why? 3

Abstract Factory regular factory encodes product class names. May be inconvenient –in case need to make modification –in case need to re-use code for several related factories abstract factory design pattern – separates interface and implementation –abstract factory – specifies creation interface –abstract product – specifies product interface to be manipulated by abstract factory –abstract factory method - product creation interface –concrete factory, product, method – implementatuib of respective interfaces benefit of abstract factory pattern – client may not need to know (concrete) implementations to operate objects abstract factory pattern is a creational pattern abstract factory is often designed as a singleton pattern a factory may be part abstract/part concrete 4

Abstract Factory UML Diagram 5