Copyright © 1995-2004 Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-1 PS95&96-MEF-L10-1 Dr. M.E. Fayad Creationa.

Slides:



Advertisements
Similar presentations
Introduction to Object Orientation System Analysis and Design
Advertisements

Design Patterns.
Lecture 9 Design Patterns CSCI – 3350 Software Engineering II Fall 2014 Bill Pine.
 Recent researches show that predicative programming can be used to specify OO concepts including classes, objects, interfaces, methods, single and multiple.
18-1 Verifying Object Behavior and Collaboration Role playing – the act of simulating object behavior and collaboration by acting out an object’s behaviors.
Design Patterns for Object Oriented systems CSC 515 Ashwin Dandwate.
Patterns Reusable solutions to common object-oriented programming problems When given a programming problem, re-use an existing solution. Gang of Four.
Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Structural Patterns - Page L6-1 PS95&96-MEF-L13-1 Dr. M.E. Fayad Creationa l Paradigm.
(c) 2009 University of California, Irvine – André van der Hoek1June 13, 2015 – 21:42:16 Informatics 122 Software Design II Lecture 8 André van der Hoek.
Dept. of Computer Engineering, Amirkabir University of Tech. 1 Design Patterns Dr. Noorhosseini Introduction.
Design Patterns CS is not simply about programming
Copyright © Active Frameworks, Inc.. - All Rights Reserved - V2.0 Introduction - Page L1-1 PS95&96-MEF-L1-1 Dr. M.E. Fayad Creationa l Paradigm.
Design Patterns. What are design patterns? A general reusable solution to a commonly occurring problem. A description or template for how to solve a problem.
Copyright © Active Frameworks Inc. - All Rights Reserved.More On Behavioral Patterns - Page L9-1 PS95&96-MEF-L16-1 Dr. M.E. Fayad Creationa l.
DESIGN PATTERNS Redesigning Applications And
Dept. of Computer Engineering, Amir-Kabir University 1 Design Patterns Dr. Noorhosseini Lecture 2.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Design Patterns.
(c) 2010 University of California, Irvine – André van der Hoek1June 29, 2015 – 08:55:05 Informatics 122 Software Design II Lecture 8 André van der Hoek.
Design Patterns Module Name - Object Oriented Modeling By Archana Munnangi S R Kumar Utkarsh Batwal ( ) ( ) ( )
Basic Design Patterns 1. Introduction Gabriel Mañana Ed. 453 Of. 120 Ext
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
(c) 2010 University of California, Irvine – André van der Hoek1July 16, 2015 – 13:45:31 Informatics 122 Software Design II Lecture 8 Nick Lopez Duplication.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Idioms and Patterns polymorphism -- inheritance and delegation idioms -- realizing.
Design Patterns Discussion of pages: xi-11 Sections: Preface, Forward, Chapter
Design Patterns Alan Shalloway, James Trott, Design Patterns Explained, Addison-Wesley, Gamma, Helm, Johnson, Vlissides, Design Patterns, Elements.
05 - Patterns Intro.CSC4071 Design Patterns Designing good and reusable OO software is hard. –Mix of specific + general –Impossible to get it right the.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Unified Modeling Language, Version 2.0
Design Patterns in Java Chapter 1 Introduction Summary prepared by Kirk Scott 1.
Powerpoint Templates Page 1 Powerpoint Templates What is Design Patterns ? by Indriati Teknik Informatika – UB.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 27. Review UML dynamic view – State Diagrams.
Design Patterns CSCI 5801: Software Engineering. Design Patterns.
DESIGN PATTERNS CSC532 Adv. Topics in Software Engineering Shirin A. Lakhani.
18 April 2005CSci 210 Spring Design Patterns 1 CSci 210.
Software Design Patterns (1) Introduction. patterns do … & do not … Patterns do... provide common vocabulary provide “shorthand” for effectively communicating.
Object Oriented Software Engineering Chapter 16 and 17 review 2014/06/03.
Design Patterns CS 124 Reference: Gamma et al (“Gang-of-4”), Design Patterns.
Design Principle & Patterns by A.Surasit Samaisut Copyrights : All Rights Reserved.
ECE450S – Software Engineering II
Design Patterns CSIS 3701: Advanced Object Oriented Programming.
Behavioral Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
CS616: Software Engineering Spring 2009 Design Patterns Sami Taha.
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
Design Patterns. 1 Paradigm4 Concepts 9 Principles23 Patterns.
Design Patterns Introduction
BEHAVIORAL PATTERNS 13-Sep-2012 Presenters Sanjeeb Kumar Nanda & Shankar Gogada.
Week 04 Object Oriented Analysis and Designing. What is a model? A model is quicker and easier to build A model can be used in simulations, to learn more.
Design Patterns Introduction “Patterns are discovered, not invented” Richard Helm.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Five Minute Design Patterns Doug Marttila Forest and the Trees May 30, 2009 Template Factory Singleton Iterator Adapter Façade Observer Command Strategy.
1 Good Object-Oriented Design Dr. Radu Marinescu Lecture 4 Introduction to Design Patterns.
Basic Characteristics of Object-Oriented Systems
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Design Patterns CSCE 315 – Programming Studio Spring 2013.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
Design Patterns: MORE Examples
Chapter 10 Design Patterns.
Chapter 5:Design Patterns
Software Design Patterns
MPCS – Advanced java Programming
Introduction to Design Patterns
Design Patterns Lecture part 2.
Introduction to Design Patterns
object oriented Principles of software design
DESIGN PATTERNS B.TECH IV YR II SEMESTER(TERM 08-09)
Informatics 122 Software Design II
Patterns.
DESIGN PATTERNS : Introduction
Informatics 122 Software Design II
Presentation transcript:

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-1 PS95&96-MEF-L10-1 Dr. M.E. Fayad Creationa l Paradigm Shift, Inc. Software Factory Behaviora l Structural Lesson 3: Cataloging of Design Patterns Object-Oriented Design Patterns

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-2 PS95&96-MEF-L10-2 Dr. M.E. Fayad Lesson Objectives oShow how to catalog each of the design patterns using a standard template or Gamma’s template. oCompare Gamma’s template with other template oShow how to select a Design Pattern oShow how to use a Design Pattern oPresent cataloging assumptions

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-3 PS95&96-MEF-L10-3 Dr. M.E. Fayad Design Patterns Must be Documented in a Catalog Patterns are Everywhere!

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-4 PS95&96-MEF-L10-4 Dr. M.E. Fayad Definition and Template Design Patterns are defined in terms of object-oriented concepts. Design Patterns are sufficiently abstract to avoid specifying implementation details, thereby ensuring wide applicability. But a pattern may provide hints about potential implementation issues. Each design pattern in the catalog is described using a standard template. Three major benefits of the template: –Ensure uniformity between entries in the catalog –Document each pattern in the appropriate level of details –Help compare similar patterns

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-5 PS95&96-MEF-L10-5 Dr. M.E. Fayad Design Pattern Template Design Pattern’s NameJurisdiction Characterization Intent Also Known As Motivation Applicability Structure Participants Collaborations Consequences Implementation Sample Code Known Uses Related Patterns Observer

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-6 PS95&96-MEF-L10-6 Dr. M.E. Fayad Pattern Name and Classification –The pattern’s name conveys the essence of the pattern succinctly –A good name is vital because it will become part of the design vocabulary. Intent: a short statement that answers the following questions: –What does the design pattern do? –What is its rationale and intent? –What particular design issue or problem does it address? Also Known As –Other well-known names for the pattern, if any. Design Pattern Template (cont’d)

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-7 PS95&96-MEF-L10-7 Dr. M.E. Fayad Motivation –A scenario that illustrates a design problem and how the class & object structures in the pattern solve the problem. Applicability –What are the situations in which the design pattern can be applied? –What are examples of poor designs that the pattern can address? –How can you recognize these situations? Structure –A graphical representation of the classes in the pattern using a notation based on the Object Modeling Technique (OMT) [Rumbaugh 92] and Booch notations [Booch 94]. –We also use Interaction diagram [Jacobson 92 & Booch 94] to illustrate sequences of requests and collaborations between objects Design Pattern Template (cont’d)

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-8 PS95&96-MEF-L10-8 Dr. M.E. Fayad Participants –Classes and objects and their responsibilities Collaborations –How the participants collaborate to carry out their responsibilities. Consequences –How does pattern support its objectives? –What are the trade-offs and results of using the pattern? –What aspect of system structure does it let you vary independently? Implementation –What pitfalls, hints, or technique should you be aware of when implementing the pattern? –Are there language-specific issues? Design Pattern Template (cont’d)

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-9 PS95&96-MEF-L10-9 Dr. M.E. Fayad Sample code –Code fragments that illustrate how you can implement the pattern in C++ or smalltalk Known Uses –Examples of the pattern found in real systems Related Patterns –What design patterns are closely related to this one? –What are the important differences? –With which other patterns should this one be used? Design Pattern Template (cont’d)

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-10 PS95&96-MEF-L10-10 Dr. M.E. Fayad Frank Bushmann added three extra fields to the Gamma’s template: Dynamic Behavior –The dynamic behavior of a pattern is illustrated Methodology –The methodology (steps) for constructing a pattern is listed Variants –Possible variants of the pattern are listed and described Design Pattern Template (cont’d)

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-11 PS95&96-MEF-L10-11 Dr. M.E. Fayad Common Causes of Reuse Errors in OO Software & Design Patterns  Particular implementation class when creating an object  Particular operations  Operating environment  Specific Representation or implementation  Particular algorithms ‘Particular clients and inter-object relationships ’Subclassing as an extension mechanism. Dependence on:

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-12 PS95&96-MEF-L10-12 Dr. M.E. Fayad How to Select a Design Pattern  Consider how design patterns solve design problems  Scan intent sections  Study how patterns interrelate  Study patterns of like purpose  Examine the cause of redesign ‘ Consider what should be variable in your design

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-13 PS95&96-MEF-L10-13 Dr. M.E. Fayad How to Use a Design Pattern  Identify the classes in the application which will be constructed by introducing the design pattern  Identify the classes in the pattern  Select meaningful names for these classes in the context of the application  Define the classes, establish their inheritance relationships, and define their instance variables  Define application-specific names for operations in the pattern ‘ Implement the operations to carry out the responsibilities and collaborations in the pattern

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-14 PS95&96-MEF-L10-14 Dr. M.E. Fayad Design Patterns Classification is Based on Two Orthogonal Criteria First classification criterion reflects what a pattern does: –Creational patterns concern the process of object creation –Structural patterns deal with the composition of classes or objects –Behavioral patterns characterize the ways in which classes or objects interact and distribute responsibilities Second classification criterion reflects to what object- oriented concepts the pattern is applied: –Class patterns deal with relationships between base classes and their subclasses; class patterns cover static semantics –Object patterns concern relationships between peer objects –Compound patterns deal with recursive object structures

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-15 PS95&96-MEF-L10-15 Dr. M.E. Fayad Design Pattern Space Character- ization Jurisdiction Class Factory Method Adaptor (c) Template Method Bridge (c) Creational Structural Behavioral Object Abstract Factory Adaptor (o) Chain of Responsibility Prototype Bridge (o) Command Solitaire Facade Iterator (o) Flyweight Mediator Proxy Memento Observer Strategy Compound Builder Composite Interpreter Decorator Iterator (cc) Walker

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-16 PS95&96-MEF-L10-16 Dr. M.E. Fayad Creational Patterns The Creational Class Patterns defer some part of object creation to subclasses. The Creational Object Patterns abstract how sets of objects are created. The Creational Compound Patterns are concerned with the creation of recursive object structures.

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-17 PS95&96-MEF-L10-17 Dr. M.E. Fayad Structural Patterns The Structural Class Patterns use inheritance to compose protocols or code. The Structural Object Patterns describe ways to assemble objects to realize new functionality. The Structural Compound Patterns capture techniques for structuring recursive object structures.

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-18 PS95&96-MEF-L10-18 Dr. M.E. Fayad Behavioral Patterns The Behavioral Class Patterns capture how classes cooperate with their subclasses to fulfill their semantics. The Behavioral Object Patterns describe how a group of peer objects cooperate to perform a task that no single object can carry out alone. The Behavioral Compound Patterns deal with behavior in recursive object structures.

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-19 PS95&96-MEF-L10-19 Dr. M.E. Fayad Classification Scheme This is another classification scheme that is introduced by Frank Buschmann. The classification scheme consists of three categories of design issue: 1.Granularity 2.Functionality 3.Structural principles

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-20 PS95&96-MEF-L10-20 Dr. M.E. Fayad Granularity There are three levels of granularity: 1.Architectural Frameworks –represent fundamental principles for structuring software systems into subsystems and the relationships between them. 2.Design Patterns –describe basic schemes for structuring subsystems and components of software architecture, as well as their relationships. 3.Idioms –describe how to implement particular components (parts) of subsystem and component functionality, or their relationships to other components within a given design.

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-21 PS95&96-MEF-L10-21 Dr. M.E. Fayad Functionality Four categories : 1. Creation of objects –Patterns may specify how to create particular instances of complex recursive or aggregate object structures 2. Guiding communication between objects –Patterns may describe how to organize the communication between a set of collaborating objects 3.Access to objects –Patterns may describe how to access the services and state of shared or remote objects in a safe way, without violating their encapsulation of state and behavior 4.Organizing the computation of complex functions –Patterns may specify how to distribute responsibilities among cooperating objects to solve a more complex function or task

Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-22 PS95&96-MEF-L10-22 Dr. M.E. Fayad Structural Principles Four categories : 1. Abstraction –A pattern provides an abstract or generalized view of particular (often complex) entity or task in a software system 2. Encapsulation –A pattern encapsulates details of a particular object, component, and services to remote dependency on the pattern from its clients or to protect these details from access. 3.Separation of concerns –A pattern factors out specific responsibilities into separate objects to solve a particular task. 4.Coupling and cohesion –A pattern removes or relaxes the structural and communication relationships and dependencies between strongly coupled objects