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

Slides:



Advertisements
Similar presentations
Welcome to. Who am I? A better way to code Design Patterns ???  What are design patterns?  How many are there?  How do I use them?  When do I use.
Advertisements

18-1 Verifying Object Behavior and Collaboration Role playing – the act of simulating object behavior and collaboration by acting out an object’s behaviors.
CS590L - Lecture 6 1 CS590L Distributed Component Architecture References: - E. Gamma, R. Helm, R. Johnson, J. Vlissides, Design Patterns: Elements of.
Patterns Reusable solutions to common object-oriented programming problems When given a programming problem, re-use an existing solution. Gang of Four.
05/26/2004www.indyjug.net1 Indy Java User’s Group June Knowledge Services, Inc.
(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.
Spring 2010CS 2251 Design Patterns. Spring 2010CS 2252 What is a Design Pattern? "a general reusable solution to a commonly occurring problem in software.
Design Patterns William A. Hoffman NYU OOP Class.
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 ( ) ( ) ( )
Design Patterns Ref : Chapter 15 Bennett et al. useful groups of collaborating classes that provide a solution to commonly occuring problems. provide.
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.
Vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Idioms and Patterns polymorphism -- inheritance and delegation idioms -- realizing.
Design Patterns Alan Shalloway, James Trott, Design Patterns Explained, Addison-Wesley, Gamma, Helm, Johnson, Vlissides, Design Patterns, Elements.
Patterns 1 Patterns in OO - history 77 - Work of the architect Christopher Alexander 80s - Kent Beck playing with Smalltalk 91 - Gamma’s PhD thesis on.
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.
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
Creational Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
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.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
DESIGN PATTERNS CSC532 Adv. Topics in Software Engineering Shirin A. Lakhani.
Software Design Patterns (1) Introduction. patterns do … & do not … Patterns do... provide common vocabulary provide “shorthand” for effectively communicating.
CSE 403 Lecture 14 Design Patterns. Today’s educational objective Understand the basics of design patterns Be able to distinguish them from design approaches.
Design Patterns CS 124 Reference: Gamma et al (“Gang-of-4”), Design Patterns.
CSE 403, Spring 2008, Alverson Software Design “There are two ways of constructing a software design: one way is to make it so simple that there are obviously.
Design Principle & Patterns by A.Surasit Samaisut Copyrights : All Rights Reserved.
Testing Extensible Design Patterns in OO Frameworks through Scenario Templates D.S. Sanders Software Verification & Validation.
ECE450S – Software Engineering II
Design Patterns CSIS 3701: Advanced Object Oriented Programming.
Introduction to Design Patterns. Questions What is a design pattern? Who needs design patterns? How different are classes and objects in APL compared.
1 Design Patterns Object-Oriented Design. 2 Design Patterns 4Reuse of design knowledge and experience 4Common in many engineering disciplines 4Avoids.
05/26/2004www.indyjug.net1 Indy Java User’s Group May Knowledge Services, Inc.
What to know for the exam. Smalltalk will be used for questions, but there will not be questions about the grammar. Questions might ask – how particular.
Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-1 PS95&96-MEF-L10-1 Dr. M.E. Fayad Creationa.
CS616: Software Engineering Spring 2009 Design Patterns Sami Taha.
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
Advanced Object-Oriented Design Patterns and Architectures Part One COEN396A John Xiao
Design Patterns. 1 Paradigm4 Concepts 9 Principles23 Patterns.
Design Patterns Introduction
CS251 – Software Engineering Lectures 18: Intro to DP Slides by Rick Mercer, Christian Ratliff, Oscar Nierstrasz and others 1 و ابتغ فيما آتاك الله الدار.
Design Patterns in Context ©SoftMoore ConsultingSlide 1.
1 Good Object-Oriented Design Dr. Radu Marinescu Lecture 4 Introduction to Design Patterns.
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Design Patterns CSCE 315 – Programming Studio Spring 2013.
Design Patterns: MORE Examples
The Object-Oriented Thought Process Chapter 15
Chapter 10 Design Patterns.
Chapter 5:Design Patterns
Software Design Patterns
Introduction to Design Patterns
Design Patterns Lecture part 2.
Introduction to Design Patterns
Design Patterns.
object oriented Principles of software design
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2005 Instructor: Patrice Chalin.
Presented by Igor Ivković
Informatics 122 Software Design II
DESIGNING YOUR SYSTEM.
DESIGN PATTERNS : Introduction
Informatics 122 Software Design II
Presented by Igor Ivković
Presentation transcript:

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

Software Architecture2 Motivation n Vehicle for reasoning about design or architecture at a higher level of abstraction (design confidence) n Mining or discovering design patterns in legacy systems n Software architecture dissemination of good design, design reusedissemination of good design, design reuse n Engineering Handbooks contain a wealth of experiencecontain a wealth of experience

Software Architecture3 Software Patterns n Design patterns [GoF] n Pattern languages [Coplien] n Software idioms [Coplien] n Analysis patterns [Fowler] n AntiPatterns [Brown] n Frameworks n STL (C++ Template Library) n Algorithms and data structures

Software Architecture4 Software Patterns... n Conceptual patterns n Architectural patterns n Design patterns n Generative patterns n Programming patterns or idioms n Analysis patterns n AntiPatterns n Organizational patterns

Software Architecture5 Pattern Definitions n A pattern is a named nugget of insight that conveys the essence of a proven solution to a recurring problem within a certain context amidst competing concerns [Riehle] n A pattern is the abstraction from a concrete form which keeps recurring in specific non-arbitrary contexts.

Software Architecture6 Pattern Definitions... n A pattern is a named nugget of instructive information that captures the essential structure and insight of a successful family of proven solutions to a recurring problem that arises within a certain context and system forces.

Software Architecture7 Pattern Definitions... n Description of communicating objects and classes that are customized to solve a general design in a particular context [GoF]. n Design patterns capture the static and dynamic structures of solutions that occur repeatedly when producing applications in a particular context [Coplien].

Software Architecture8 Historical Perspective on Design Patterns n 1979 Alexander’s Timeless Way of BuildingAlexander’s Timeless Way of Building n 1987 OOPSLA workshop by Beck & WardOOPSLA workshop by Beck & Ward n 1994 First PLoP conferenceFirst PLoP conference n 1995 GoF (Gamma, Helm, Johnson, Vlissides)GoF (Gamma, Helm, Johnson, Vlissides) Design Patterns; Elements of Reusable Object-Oriented SoftwareDesign Patterns; Elements of Reusable Object-Oriented Software

Software Architecture9 A Good Pattern n It solves a problem Patterns capture solutions, not just abstract principles or strategiesPatterns capture solutions, not just abstract principles or strategies n It is a proven concept Patterns capture solutions with a track record, not theories or speculationPatterns capture solutions with a track record, not theories or speculation n The solution isn’t obvious The best patterns generate a solution indirectly; normal for many design problemsThe best patterns generate a solution indirectly; normal for many design problems

Software Architecture10 A Good Pattern... n It describes a relationship Patterns describe more than black boxes: system structures and mechanismsPatterns describe more than black boxes: system structures and mechanisms n The pattern has a significant human component The best patterns explicitly appeal to aesthetics and utilityThe best patterns explicitly appeal to aesthetics and utility

Software Architecture11 Patterns Formats n GoF format n Alexandrian form (canonical form) n Essential components of a pattern format Name, problem, context, forcesName, problem, context, forces Solution, examples, context,Solution, examples, context, Rationale, related patterns, known usesRationale, related patterns, known uses

Software Architecture12 Pattern Format... n Name meaningful phrasemeaningful phrase n Problem a statement of the problem which describes its intent: the goals and objectives it wants to reach within the given context and forcesa statement of the problem which describes its intent: the goals and objectives it wants to reach within the given context and forces

Software Architecture13 Pattern Format... n Context preconditions under which the problem and its solutions seem to occurpreconditions under which the problem and its solutions seem to occur the pattern’s applicabilitythe pattern’s applicability may change over timemay change over time n Forces relevant forces and constraints and their interactions and conflictsrelevant forces and constraints and their interactions and conflicts motivational scenario for the patternmotivational scenario for the pattern

Software Architecture14 Pattern Format... n Solution Static and dynamic relationships describing how to realize the patternStatic and dynamic relationships describing how to realize the pattern instructions on how to construct the work products instructions on how to construct the work products pictures, diagrams, prose which highlight the pattern’s structure, participants, and collaborationspictures, diagrams, prose which highlight the pattern’s structure, participants, and collaborations

Software Architecture15 Pattern Format... n Examples one or more sample applications to illustrateone or more sample applications to illustrate –a specific context –how the pattern is applied n Resulting context the state or configuration after the pattern has been appliedthe state or configuration after the pattern has been applied consequences (good and bad) of applying the patternconsequences (good and bad) of applying the pattern

Software Architecture16 Pattern Format... n Rationale justification of the steps or rules in the patternjustification of the steps or rules in the pattern how and why it resolves the forces to achieve the desired goals, principles, and philosophieshow and why it resolves the forces to achieve the desired goals, principles, and philosophies how are the forces orchestrated to achieve harmonyhow are the forces orchestrated to achieve harmony how does the pattern actually workhow does the pattern actually work

Software Architecture17 Pattern Format... n Related patterns the static and dynamic relationships between this pattern and other patternsthe static and dynamic relationships between this pattern and other patterns n Known uses to demonstrate that this is a proven solution to a recurring problemto demonstrate that this is a proven solution to a recurring problem

Software Architecture18 Qualities of a Pattern n Encapsulation and abstraction encapsulates a well-defined problem and its solution in a particular domainencapsulates a well-defined problem and its solution in a particular domain provides crisp, clear boundaries to crystallize the problem and solution spacesprovides crisp, clear boundaries to crystallize the problem and solution spaces serves as an abstraction which embodies domain knowledge and experienceserves as an abstraction which embodies domain knowledge and experience may occur at different levels of abstractionmay occur at different levels of abstraction

Software Architecture19 Qualities of a Pattern... n Openness and variability is open for extension and parameterization by other patternsis open for extension and parameterization by other patterns is able to solve larger problems in concert with other patternsis able to solve larger problems in concert with other patterns can be realized by a variety of implementations (variants)can be realized by a variety of implementations (variants)

Software Architecture20 Qualities of a Pattern... n Generativity and composability applying a pattern once provides a context for further applicationsapplying a pattern once provides a context for further applications patterns are easier to apply in another context than C++ codepatterns are easier to apply in another context than C++ code can evolve into Golden Hammer AntiPatterncan evolve into Golden Hammer AntiPattern

Software Architecture21 Qualities of a Pattern... n Equilibrium realizes a balance among its forces and constraintsrealizes a balance among its forces and constraints realizes an invariant, heuristics, or a policy which minimizes conflict within the solution spacerealizes an invariant, heuristics, or a policy which minimizes conflict within the solution space an invariant characterizes the problem solving philosophyan invariant characterizes the problem solving philosophy

Software Architecture22 GoF Catalog of 23 Design Patters n Creational patterns Creational patterns Creational patterns Abstract the instantiation processAbstract the instantiation process Make the system independent on how the objects are created, composed, and representedMake the system independent on how the objects are created, composed, and represented –Abstract Factory Abstract FactoryAbstract Factory –Builder Builder –Factory Method Factory MethodFactory Method –Prototype Prototype –Singleton Singleton

Software Architecture23 GoF Catalog of 23 Design Patters... n Structural patterns Structural patterns Structural patterns Composition of classes and objects to form larger structuresComposition of classes and objects to form larger structures Compose classes to form new interfacesCompose classes to form new interfaces Compose objects to provide new functionalityCompose objects to provide new functionality –Adaptor Adaptor –Bridge Bridge –Composite Composite –Decorator Decorator –Façade Façade –Flyweight Flyweight –Proxy Proxy

Software Architecture24 GoF Catalog of 23 Design Patters... n Behavioral patterns Behavioral patterns Behavioral patterns concerned with algorithms and the assignment of responsibilities among objectsconcerned with algorithms and the assignment of responsibilities among objects –Chain of Responsibility –Command –Interpreter –Iterator Iterator –Mediator –Memento –Observer –State –Strategy –Template Method –Visitor

Software Architecture25 Summary n Vehicle for reasoning about design, architecture, component technology n GoF book is great but there are many other software patterns