Design Patterns #3. Reid Holmes. Material and some slide content from: - GoF Design Patterns Book - Head First Design Patterns

Similar documents
Material and some slide content from: - GoF Design Patterns Book. Design Patterns #1. Reid Holmes. Lecture 11 - Tuesday October

Design Patterns Reid Holmes

Design Patterns Reid Holmes

SDC Design patterns GoF

Ingegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1

Design Patterns B. Reid Holmes. Material and some slide content from: - Head First Design Patterns Book - GoF Design Patterns Book

Object-Oriented Design

Design Patterns. An introduction

Produced by. Design Patterns. MSc in Communications Software. Eamonn de Leastar

Facade and Adapter. Comp-303 : Programming Techniques Lecture 19. Alexandre Denault Computer Science McGill University Winter 2004

Design Pattern. CMPSC 487 Lecture 10 Topics: Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, et al.)

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

Creational Design Patterns

Design Patterns V Structural Design Patterns, 2

Lecture 20: Design Patterns II

Object-Oriented Oriented Programming

Modellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico

OODP Session 4. Web Page: Visiting Hours: Tuesday 17:00 to 19:00

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D.

An Introduction to Patterns

Slide 1. Design Patterns. Prof. Mirco Tribastone, Ph.D

Design of Software Systems (Ontwerp van SoftwareSystemen) Design Patterns Reference. Roel Wuyts

Design Patterns. Manuel Mastrofini. Systems Engineering and Web Services. University of Rome Tor Vergata June 2011

Trusted Components. Reuse, Contracts and Patterns. Prof. Dr. Bertrand Meyer Dr. Karine Arnout

» Building a user interface toolkit that supports multiple look and feel standards WINDOWS XP, MAC OS X, Motif, Presentation Manager, X Window

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

The Strategy Pattern Design Principle: Design Principle: Design Principle:

Review Software Engineering October, 7, Adrian Iftene

Laboratorio di Progettazione di Sistemi Software Design Pattern Creazionali. Valentina Presutti (A-L) Riccardo Solmi (M-Z)

Design Pattern- Creational pattern 2015

Using Design Patterns in Java Application Development

Creational Patterns. Factory Method (FM) Abstract Factory (AF) Singleton (SI) Prototype (PR) Builder (BU)

Tuesday, October 4. Announcements

Keywords: Abstract Factory, Singleton, Factory Method, Prototype, Builder, Composite, Flyweight, Decorator.

Design Pattern What is a Design Pattern? Design Pattern Elements. Almas Ansari Page 1

Software Design COSC 4353/6353 D R. R A J S I N G H

Applying Design Patterns to SCA Implementations

EPL 603 TOPICS IN SOFTWARE ENGINEERING. Lab 6: Design Patterns

SOFTWARE PATTERNS. Joseph Bonello

Design Patterns. Hausi A. Müller University of Victoria. Software Architecture Course Spring 2000

Provide an interface for creating families of related or dependent objects without specifying their concrete classes

An Introduction to Patterns

Lecture 21: Design Patterns III

Design Patterns. Comp2110 Software Design. Department of Computer Science Australian National University. Second Semester

Modellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico

CS342: Software Design. November 21, 2017

Software Eningeering. Lecture 9 Design Patterns 2

Design Patterns Lecture 2

A Reconnaissance on Design Patterns

Design patterns. Jef De Smedt Beta VZW

Design Patterns in Python (Part 2)

Topics in Object-Oriented Design Patterns

CISC 322 Software Architecture

Chapter 8, Design Patterns Visitor

Reuse at Design Level: Design Patterns

Lecture Material. Design Patterns. Visitor Client-Server Factory Singleton

From Design Patterns: Elements of Reusable Object Oriented Software. Read the sections corresponding to patterns covered in the following slides.

1 Software Architecture

Second Midterm Review

Introduction and History

Design Patterns Cont. CSE 110 Discussion - Week 9

Object-oriented Software Design Patterns

Socket attaches to a Ratchet. 2) Bridge Decouple an abstraction from its implementation so that the two can vary independently.

Ingegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1

Laboratorio di Tecnologie dell'informazione. Ing. Marco Bertini

Lectures 24 and 25 Introduction to Architectural Styles and Design Patterns

Designing applications. Main concepts to be covered

Application Architectures, Design Patterns

Design Patterns: Structural and Behavioural

UNIT I Introduction to Design Patterns

Produced by. Design Patterns. MSc in Communications Software. Eamonn de Leastar

LECTURE NOTES ON DESIGN PATTERNS MCA III YEAR, V SEMESTER (JNTUA-R09)

Design Patterns. Dr. Rania Khairy. Software Engineering and Development Tool

Design Patterns. Observations. Electrical Engineering Patterns. Mechanical Engineering Patterns

Design patterns. OOD Lecture 6

Introduction to Software Engineering: Object Design I Reuse & Patterns

Design Patterns. CSC207 Fall 2017

UML and Objectorientation. Kristian Sandahl

CPSC 310 Software Engineering. Lecture 11. Design Patterns

APPLYING DESIGN PATTERNS TO SCA IMPLEMENTATIONS

THOMAS LATOZA SWE 621 FALL 2018 DESIGN PATTERNS

administrivia today UML start design patterns Tuesday, September 28, 2010

CS/CE 2336 Computer Science II

Design Patterns. CSE870: Advanced Software Engineering (Design Patterns): Cheng

Software Design COSC 4353/6353 D R. R A J S I N G H

Design Patterns! Acknowledgements!

Summary of the course lectures

Tecniche di Progettazione: Design Patterns

Singleton Pattern Creational

Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns

Applying the Observer Design Pattern

Design Pattern and Software Architecture: IV. Design Pattern

Object-Oriented Oriented Programming Factory Method Pattern Abstract Factory Pattern. CSIE Department, NTUT Woei-Kae Chen

Software Engineering - I An Introduction to Software Construction Techniques for Industrial Strength Software

DESIGN PATTERN - INTERVIEW QUESTIONS

Object-Oriented Design

VOL. 4, NO. 12, December 2014 ISSN ARPN Journal of Science and Technology All rights reserved.

CS251 Software Engineering Lectures 18: Intro to DP

Applying the Factory Method Design Pattern

CSE870: Advanced Software Engineering (Cheng) 1

Transcription:

Material and some slide content from: - GoF Design Patterns Book - Head First Design Patterns Design Patterns #3 Reid Holmes Lecture 16 - Thursday November 15 2011.

GoF design patterns $ %!!!! $ "! # &

Factory Method Intent: Provide an interface for creating an object but let subclasses decide which class to instantiate Implementation: Create an abstract method (e.g. createpizza()) Let subclasses implement method In this way the subclasses control instantiation without the client knowing what is being created

Abstract factory Intent: Provide an interface for creating families of related objects without specifying their concrete classes Motivation: Consider a multi-platform UI toolkit. A WidgetFactory can provide an interface to make sure the right widget is instantiated for each platform. Applicability: When a system should be independent of how its products are created and represented. A system contains multiple families of products. You want to reveal interfaces, not implementations.

Abstract factory Structure Participants: Abstract/Concrete Factory Abstract/Concrete Product Client

Abstract factory Collaborations Usually only one Abstract Factory (singleton). Objects are created by concrete factories. Consequences: Isolates concrete classes from clients. (Clients only know about interfaces, not implementations) Makes exchanging families easy. (Concrete family reference appears only once) Makes adding products hard. (Abstract + all concrete factories must be updated.)

Abstract factory Implementation: Create abstract factory interface. Use factory method to create descriptive names. Create concrete products/factories. Associate client with one factory. Known uses: Frequently used in widget toolkits. Related to: Often implemented with Factory Method or Prototypes. Concrete factories are often Singletons. XXX: Elaborate on Complex(..) example and the utility of the Factory Method.

Dependency Inversion Depend upon abstractions, not concrete classes. Instantiations are references to concrete classes Factories allow high-level components to depend on abstractions Low-level components can then implement those abstractions and depend upon them Hints:

Facade Intent: Provide a unified, higher-level, interface to a whole module making it easier to use. Motivation: Composing classes into subsystems reduces complexity. Using a Facade minimizes the communication dependencies between subsystems. Applicability: When you want a simple interface to a complex subsystem. There are many dependencies between clients and a subsystem. You want to layer your subsystems.

Facade REID HOLMES - SE2: SOFTWARE DESIGN & ARCHITECTURE

Facade Participants: Facade Subsystem classes Collaborations: Clients interact subsystem via Facade. Consequences: Shields clients from subsystem components. Promotes weak coupling. (strong within subsystem, weak between them) Doesn t prevent access to subsystem classes.

Facade Implementation: 1) Analyze client / subsystem tangling. 2) Create interface. Abstract factories can also be used to add further decoupling. Known uses: Varied. Related to: Abstract Factory can be used with Facade to create subsystem objects. Facades are frequently Singletons. Abstracts functionality similar to Mediator but does not concentrate on communication.

Activity 5 mins: Right side: Develop a use for a observer or command pattern for your system. Left side: Develop a usage of a decorator pattern or abstract factory for your system. 10 mins (5 / group): Match up with team from other side of room. Explain your pattern and how it improves your system s design.