GoF Sections 1.6-1.8 Design Problems and Design Patterns.

Slides:



Advertisements
Similar presentations
Chain of Responsibility Pattern Gof pp Yuyang Chen.
Advertisements

Creational Patterns, Abstract Factory, Builder Billy Bennett June 11, 2009.
Observer Method 1. References Gamma Erich, Helm Richard, “Design Patterns: Elements of Reusable Object- Oriented Software” 2.
Matt Klein. Decorator Pattern  Intent  Attach Additional responsibilities to an object by dynamically. Decorators provide a flexible alternative to.
1 Structural Design Patterns - Neeraj Ray. 2 Structural Patterns - Overview n Adapter n Bridge n Composite n Decorator.
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
Linzhang Wang Dept. of Computer Sci&Tech, Nanjing University The Bridge Pattern.
The Bridge Pattern.. Intent Decouple an abstraction from its implementation so that the two can vary independently Also known as: Handle/Body.
Matt Klein 7/2/2009.  Intent  Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request.
Reza Gorgan Mohammadi AmirKabir University of Technology, Department of Computer Engineering & Information Technology Advanced design.
(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 Redesigning Applications And
Dept. of Computer Engineering, Amir-Kabir University 1 Design Patterns Dr. Noorhosseini Lecture 2.
(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.
GoF Sections 2.7 – 2.9 More Fun with Lexi. Lexi Document Editor Lexi tasks discussed:  Document structure  Formatting  Embellishing the user interface.
Reuse Activities Selecting Design Patterns and Components
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Creational Patterns Making Objects The Smart Way Brent Ramerth Abstract Factory, Builder.
Design Patterns CS 124 Reference: Gamma et al (“Gang-of-4”), Design Patterns.
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.
Design Patterns.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
1 GoF Template Method (pp ) GoF Strategy (pp ) PH Single User Protection (pp ) Presentation by Julie Betlach 6/08/2009.
05 - Patterns Intro.CSC4071 Design Patterns Designing good and reusable OO software is hard. –Mix of specific + general –Impossible to get it right the.
Case Studies on Design Patterns Design Refinements Examples.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
©Fraser Hutchinson & Cliff Green C++ Certificate Program C++ Intermediate Decorator, Strategy, State Patterns.
Creational Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 27. Review UML dynamic view – State Diagrams.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Design Patterns IX Interpreter, Mediator, Template Method recap.
L11-12: Design Patterns Definition Iterator (L4: Inheritance)‏ Factory (L4: Inheritance)‏ Strategy (L5: Multiple Inheritance)‏ Composite (L6: Implementation.
Design Patterns CS 124 Reference: Gamma et al (“Gang-of-4”), Design Patterns.
Design Principle & Patterns by A.Surasit Samaisut Copyrights : All Rights Reserved.
Structural Design Patterns
ECE450S – Software Engineering II
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Design Patterns VIII Chain of Responsibility, Strategy, State.
Factory Method Explained. Intent  Define an interface for creating an object, but let subclasses decide which class to instantiate.  Factory Method.
Linzhang Wang Dept. of Computer Sci&Tech, Nanjing University The Strategy Pattern.
FacadeDesign Pattern Provide a unified interface to a set of interfaces in a subsystem. Defines a high level interface that makes the subsystem easier.
Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-1 PS95&96-MEF-L10-1 Dr. M.E. Fayad Creationa.
Design Pattern. Definition: A design pattern is a general reusable solution to a commonly occurring problem within a given context in software design.
1 Design Patterns a Presentation by Sascha Konrad.
CSE 332: Design Patterns Review: Design Pattern Structure A design pattern has a name –So when someone says “Adapter” you know what they mean –So you can.
Interfaces About Interfaces Interfaces and abstract classes provide more structured way to separate interface from implementation
Design Reuse Earlier we have covered the re-usable Architectural Styles as design patterns for High-Level Design. At mid-level and low-level, design patterns.
Design Patterns Introduction “Patterns are discovered, not invented” Richard Helm.
Pattern Bridge. Definition Bridge is the structural pattern that separates abstraction from the implementation so that both of them can be changed independently.
Advanced Object-oriented Design Patterns Creational Design Patterns.
CS 5150 Software Engineering Lecture 16 Program Design 3.
Design Patterns: Structural Design Patterns General and reusable solutions to common problems in software design Software University
Behavioural Patterns GoF pg Iterator GoF pg. 257 – 271 Memento GoF pg By: Dan Sibbernsen.
1 Good Object-Oriented Design Dr. Radu Marinescu Lecture 4 Introduction to Design Patterns.
Design Patterns Creational Patterns. Abstract the instantiation process Help make the system independent of how its objects are created, composed and.
COMPOSITE PATTERN NOTES. The Composite pattern l Intent Compose objects into tree structures to represent whole-part hierarchies. Composite lets clients.
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Command Pattern. Intent encapsulate a request as an object  can parameterize clients with different requests, queue or log requests, support undoable.
Design Patterns: MORE Examples
Design Patterns: Brief Examples
Strategy Design Pattern
Factory Patterns 1.
Informatics 122 Software Design II
PH Chapter 3 Thanks for the Memory Leaks Pushme-Pullyu (pp
Ms Munawar Khatoon IV Year I Sem Computer Science Engineering
Structural Patterns: Adapter and Bridge
Informatics 122 Software Design II
Presentation transcript:

GoF Sections Design Problems and Design Patterns

Warning – Reading this Book May Cause an Uncontrollable Urge to Redesign Everything Don’t Read this Book Too Close to a Deadline! Decision Related Stress  Results from having to decide whether to:  Explain to your boss why you redesigned the project a week before the ship date or  Finish a design you know isn’t right

How Design Patterns Solve Design Problems Find Appropriate Objects  Patterns bring a set of objects with them, helping ensure low- level objects and high-level abstractions are not overlooked Determine Object Granularity  Patterns determine object granularity by specifying what types of objects are required for implementing the pattern Specify Object Interfaces  Patterns describe what interfaces need to be supported and what kinds of data needs to be handled  Patterns describe relationships between interfaces and place requirements/constraints on classes and even other patterns

How Design Patterns Solve Design Problems Specify Object Implementations  Patterns give a blueprint for implementation by defining such things as class relationships (class diagrams), abstract vs. concrete classes and class vs. interface inheritance Put Reuse Mechanisms to Work  Pattern definitions specify which reuse techniques (inheritance, composition, parameterized types) apply to the pattern

How Design Patterns Solve Design Problems Relate Run-Time and Compile-Time Structures  Patterns capture the distinction between run-time and compile- time structures that aren’t always clear when looking at code and data structures Design for Change  Patterns anticipate change in certain areas of the system, thus incorporating flexibility to account for future changes without redesigning the system  The flexibility incorporated by patterns tends to generate reusable designs

Patterns and Reuse Patterns can make reuse easier in in a variety of systems with different reuse needs:  Applications (internal reuse)  Toolkits (code reuse)  Frameworks (design reuse)

Causes of Redesign and Solutions Using Patterns Explicit Class Specification  Avoid committing to a particular implementation by creating objects indirectly Dependence on Specific Operations  Provide multiple ways for satisfying requests Platform Dependence  Eliminate platform dependencies by separating abstractions from implementations Implementation/Representation Dependence  Prevent changes from cascading thorough a design by hiding implementations and representations from clients (program to an interface, not an implementation)

Causes of Redesign and Solutions Using Patterns Algorithmic Dependencies  Decouple algorithms from objects by isolating algorithms and allowing it to be replaced independently Tight Coupling  Eliminate coupling between classes to allow each class to be used (or reused) independently Subclassing  Provide alternatives to subclassing, which can be expensive (during implementation as well as at run-time) Inflexible Classes and Hierarchies  Provide ways of modifying classes when manipulation of the source code is problematic

Selecting a Design Pattern Six Approaches Noted by the Author  Consider how patterns solve design problems (section 1.6)  Scan Intent sections (section 1.4)  Study pattern interrelationships (figure 1.1)  Study patterns categorically (table 1.1)  Examine causes of redesign (pp 24,25)  Consider what needs to change (table 1.2)

Selecting a Design Pattern Additional Approaches  Beg, borrow or steal ideas from other people  Do it wrong, then fix it

Using a Design Pattern Seven Step Approach to Applying Patterns  Read the pattern to get an overview  Study the Structure, Participants and Collaborations sections  Study the sample code  Rename the participants to match the context  Define the classes  Create context-specific names for pattern operations  Implement the pattern operations Consider How Not to Apply Patterns  Need to consider consequences; patterns are one tool in the toolbox, not a panacea