Design Patterns. "Gang of Four"* Design Patterns. "Gang of Four" Design Patterns. Design Pattern. CS 247: Software Engineering Principles
|
|
- Martin Grant
- 5 years ago
- Views:
Transcription
1 CS 247: Software Engineering Principles Design Patterns Reading: Freeman, Robson, Bates, Sierra, Head First Design Patterns, O'Reilly Media, Inc Ch Strategy Pattern Ch 7 Adapter and Facade patterns Ch 8 Template Method Design Patterns CS240 covers data structure patterns: priority queue AVL tree B-tree CS34 covers algorithm patterns: divide and conquer greedy dynamic programming CS247 covers OO patterns that encapsulate design decisions that might change. These are all patterns that good programmers know. U Waterloo CS247 (Spring 207) p./29 U Waterloo CS247 (Spring 207) p.2/29 "Gang of Four"* Design Patterns Abstract OO designs that encapsulate change, to improve the modularity and flexibility of our code. i.e., increase cohesion, loosen coupling, improve information hiding How patterns help: Improve our efficiency in finding a suitable design Improve the predictability of the design quality Offer higher-level abstractions than procedures or classes Extend developers' vocabulary Ease refactoring and evolution *GoF = "Gang of Four", authors of original book on object-oriented Design Patterns U Waterloo CS247 (Spring 207) p.3/29 Purpose Creational Structural Behavioural "Gang of Four" Design Patterns OO design patterns encapsulate some design decision that might change. Design Pattern Abstract Factory Builder Factory Method Prototype Singleton Adapter Bridge Composite Decorator Facade Flyweight Proxy Chain of Responsibility Command Interpreter Iterator Mediator Memento Observer State Strategy Template Method Visitor Aspect(s) That Can Vary families of product objects how a composite objects gets created subclass of object that is instantiated class of object that is instantiated the sole instance of a class interface to an object implementation of an object structure and composition of an object responsibilities of an object without subclassing interface to a subsystem storage costs of objects how an object is accessed; its location object that can fulfill a request when and how a request is fulfilled grammar and interpretation of a language how an aggregate's elements are accessed, traversed how and which objects interact with each other what private information is stored outside an object, and when objects that depend on another object; how the dependent objects stay up to date states of an object an algorithm steps of an algorithm operations that can be applied to objects(s) without changing their class(es) Gamma, Helm, Johnson, Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software, Addison-Wesley, 995 (p.30) U Waterloo CS247 (Spring 207) p.4/29
2 Examples from SE_203: References Gamma, Helm, Johnson, Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software, Addison-Wesley, 994. Freeman and Freeman, Head First Design Patterns, O'Reilly, Code examples: U Waterloo CS247 (Spring 207) p.5/29 Problem: Duplicate Code Consider a bicycle computer that has a mode button for switching the display of different data being collected: current time, speed, distance Time hour min sec display Display setlabel (string) setunits (string) setvalue (string) display Speed speed display Distance dist U Waterloo CS247 (Spring 207) p.6/29 Similar Algorithms void Distance::showValue () { display_.setlabel ("D"); display_.setvalue (dist_); display_.setunits ("km"); void Time::showValue () { display_.setlabel ("T"); display_.setvalue (hour_ + ":" + min_ + ":" + sec_); display_.setunits ( "" ); void Speed::showValue () { display_.setlabel ("S"); display_.setvalue (speed_); display_.setunits ("km/h"); U Waterloo CS247 (Spring 207) p.7/29 Display setlabel (string) setunits (string) setvalue (string) Approach : Inheritance display Time hour min sec Function Speed speed Put common code in abstract base class's method. Can be shared by subclasses' methods. Position dist Downside: subclasses may neglect to use parent behaviour. U Waterloo CS247 (Spring 207) p.8/29
3 Inheriting Common Code void Function::showValue () { display_.setlabel (XXX); display_.setvalue (YYY); display_.setunits (ZZZ); The commonality among the classes' methods is the structure of the algorithm. The variations are data values (but the data values could just as easily be subroutine values). Approach 2: Template Method A template method is a base-class method that defines common code structure, but includes primitive operations (holes) to be defined by subclass methods. void Function::showValue (){ display_.setlabel ( thelabel() ); display_.setvalue ( thevalue() ); display_.setunits ( theunits() ); // pure virtual methods Derived classes override holes than override entire method virtual std::string Function::theLabel () = 0; virtual std::string Function::theValue () = 0; virtual std::string Function::theUnits () = 0; It is essential that: the template method be nonvirtual the primitive operations be virtual functions in the base class U Waterloo CS247 (Spring 207) p.9/29 U Waterloo CS247 (Spring 207) p.0/29 Function + - thelabel() - thevalue() - theunits() Distance dist - thelabel() - thevalue() - theunits() Template Method // template method void Function::showValue () { display_.setlabel ( thelabel() ); display_.setvalue ( thevalue() ); display_.setunits ( theunits() ); // primitive operations virtual std::string Function::theLabel() = 0; virtual std::string Function::theValue() = 0; virtual std::string Function::theUnits() = 0; string Distance::theLabel() override { return string("d"); string Distance::theValue() override { return string(dist_); string Distance::theUnits() override { return string("km"); U Waterloo CS247 (Spring 207) p./29 Template Method Pattern Problem: duplicate code Multiple subclass methods have similar algorithm structures. Solution: localize duplicate code structure in an abstract class Abstract class defines a template method (of common code) that calls pure virtual subroutines. Subclasses override the subroutines. Client AbstractClass TemplateMethod() PrimitiveOperation() PrimitiveOperation2() ConcreteClass PrimitiveOperation() PrimitiveOperation2() concrete primitive operations concrete template method abstract primitive operations ConcreteClass2 PrimitiveOperation() PrimitiveOperation2() U Waterloo CS247 (Spring 207) p.2/29
4 Example: Assignment Operation that bills a cellphone plan subscriber, based on plan type: - monthly fee - charges for additional calls Account balance + bill ( ) monthlyfee ( ) callcharges ( ) concrete template method abstract virtual primitive operations Abstract Account class Account { Account (); void bill ();... int balance_; virtual int monthlyfee() = 0; virtual int callcharges() = 0; ; CheapAccount int monthlyfee int numfreemin int ratepercall int monthlyfee ( ) int callcharges ( ) concrete primitive operations ExpensiveAccount int monthlyfee int monthlyfee ( ) int callcharges ( ) Account::Account(): balance_{0 { // template method void Account::bill() { balance_ += monthlyfee() + callcharges(); U Waterloo CS247 (Spring 207) p.3/29 U Waterloo CS247 (Spring 207) p.4/29 CheapAccount class CheapAccount : public Account { CheapAccount ( ); static const int monthlyfee_ = 25; static const int freemin_ = 250; static const int rate_ = ; int minutes_; int monthlyfee() override; int callcharges() override; ; CheapAccount::CheapAccount: minutes_{0 { int CheapAccount::monthlyFee() { return monthlyfee_; int CheapAccount::callCharges() { if ( (minutes_ - freemin_) > 0 ) return (minutes_ - freemin_) * rate_; return 0; U Waterloo CS247 (Spring 207) p.5/29 ExpensiveAccount class ExpensiveAccount : public Account { ExpensiveAccount ( ); static const int monthlyfee_ = 80; int monthlyfee() override; int callcharges() override; ; ExpensiveAccount:ExpensiveAccount( ) { int ExpensiveAccount::monthlyFee () { return monthlyfee_; int ExpensiveAccount::callCharges() { return 0; U Waterloo CS247 (Spring 207) p.6/29
5 Adapter Pattern Idea Problem: Interface mismatch between two modules. Want to reuse an existing class, but its interface does not match what is needed. Or the interface of one of our modules changes (!!) and we don't want to make major changes to the existing (working!) code. Solution: Define an Adapter class that maps one interface to another. Example: STL Stacks STL stacks are implemented by adapting the interface of a Container class (by default, deque). stack<t> push(t) pop() top() : T empty() : bool size() : int contents Container<T> empty() : bool size() : int back() : T push_back(t) pop_back() Client Adapter Existing code deque<t> vector<t> list<t> U Waterloo CS247 (Spring 207) p.7/29 U Waterloo CS247 (Spring 207) p.8/29 STL Stacks Here is a version of the implementation: template<typename T, template<typename,typename> class Container = std::deque, class A = std::allocator<t>> class stack { bool empty() const; int size() const; T& top() const; void push(const T& val); void pop(); Container<T> contents_; ; template<typename T, template<typename,typename> class C, class A> void stack::push(const T& val) {contents_.push_back(val); Adapter Pattern (object adapters) The Adapter class translates requests made to the Target interface into requests made of the Adaptee object. Client Target request() Adapter request() adaptee..* Adaptee realrequest() adaptation template<typename T, template<typename,typename> class C, class A> void stack::pop() { contents_.pop_back(); U Waterloo CS247 (Spring 207) p.9/29 adaptee->realrequest(); U Waterloo CS247 (Spring 207) p.20/29
6 Facade Design Pattern Metaphor: Facade Design Pattern Problem: complex interface. Client of subsystem interacts with multiple (complex?) classes. Solution: create a single, simplified interface (class). Restrict, simplify client's interactions with subsystem's classes. client classes FACADE subsystem classes U Waterloo CS247 (Spring 207) p.2/29 U Waterloo CS247 (Spring 207) p.22/29 Another Example Strategy Pattern Problem: Want to vary an algorithm at run-time. GUI Solution: Encapsulate the algorithm decision. Define algorithm as a component object. Use subclassing to specialize the algorithm in different ways. Controller GamePlay Player Card Deck backend of game Context performalgorithm() Strategy strategy algorithm() ConcreteStrategy algorithm() ConcreteStrategy2 algorithm() ConcreteStrategy3 algorithm() GameBoard U Waterloo CS247 (Spring 207) p.23/29 U Waterloo CS247 (Spring 207) p.24/29
7 Example A class that authenticates users, and uses a variety of authentication policies. Example 2 A card player whose strategy changes at runtime. UserSession authenticate() authpolicy AuthenticationPolicy authenticate(... ) AgilePlayer bid ( ) strategy BiddingStrategy bid( AgilePlayer ) Password authenticate(... ) Challenge-Handshake authenticate(... ) Public/Private Keys authenticate(... ) Conservative bid( AgilePlayer ) Aggressive bid( AgilePlayer ) U Waterloo CS247 (Spring 207) p.25/29 U Waterloo CS247 (Spring 207) p.26/29 Implementation class AgilePlayer { BiddingStrategy *strategy_;... AgilePlayer();... void bid ( ); void reassess_bidding_strategy( ); ; AgilePlayer::AgilePlayer() : strategy_{new Conservative { Considerations Applicability: Different variants of an algorithm. Choose/Change algorithm at runtime. Some complications: Encapsulation of context data to be operated on. All algorithms must use the same Strategy interface. void AgilePlayer::bid( ) { strategy_->bid(*this); void AgilePlayer::reassess_Bidding_Strategy( ) {... // decide to change bidding strategy delete strategy_; strategy_ = new Aggressive; U Waterloo CS247 (Spring 207) p.27/29 U Waterloo CS247 (Spring 207) p.28/29
8 Summary The goal of design patterns is to encapsulate change. Template Method Pattern: encapsulates that parts of an algorithm that is different for each derived class. Adapter Pattern: encapsulates the interface to a class. Facade Pattern: doesn t really encapsulate the subsystem classes since they re still available but does decouple the client from the subsystem. Strategy Pattern: encapsulates the algorithm to be used, such that it can be set (and changed) at runtime. U Waterloo CS247 (Spring 207) p.29/29
CS 247: Software Engineering Principles. Design Patterns
CS 247: Software Engineering Principles Design Patterns Reading: Freeman, Robson, Bates, Sierra, Head First Design Patterns, O'Reilly Media, Inc. 2004 Ch 1 Strategy Pattern Ch 7 Adapter and Facade patterns
More informationDesign Patterns. Manuel Mastrofini. Systems Engineering and Web Services. University of Rome Tor Vergata June 2011
Design Patterns Lecture 1 Manuel Mastrofini Systems Engineering and Web Services University of Rome Tor Vergata June 2011 Definition A pattern is a reusable solution to a commonly occurring problem within
More informationSDC Design patterns GoF
SDC Design patterns GoF Design Patterns The design pattern concept can be viewed as an abstraction of imitating useful parts of other software products. The design pattern is a description of communicating
More informationDesign Patterns. An introduction
Design Patterns An introduction Introduction Designing object-oriented software is hard, and designing reusable object-oriented software is even harder. Your design should be specific to the problem at
More informationDesign Patterns. Observations. Electrical Engineering Patterns. Mechanical Engineering Patterns
Introduction o to Patterns and Design Patterns Dept. of Computer Science Baylor University Some slides adapted from slides by R. France and B. Tekinerdogan Observations Engineering=Problem Solving Many
More informationSoftware Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D.
Software Design Patterns Jonathan I. Maletic, Ph.D. Department of Computer Science Kent State University J. Maletic 1 Background 1 Search for recurring successful designs emergent designs from practice
More informationObject Oriented Methods with UML. Introduction to Design Patterns- Lecture 8
Object Oriented Methods with UML Introduction to Design Patterns- Lecture 8 Topics(03/05/16) Design Patterns Design Pattern In software engineering, a design pattern is a general repeatable solution to
More informationIngegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1
Ingegneria del Software Corso di Laurea in Informatica per il Management Design Patterns part 1 Davide Rossi Dipartimento di Informatica Università di Bologna Pattern Each pattern describes a problem which
More informationDesign Patterns (Facade, Composite)
CS 247: Software Engineering Principles Design Patterns (Facade, Composite) Reading: Freeman, Robson, Bates, Sierra, Head First Design Patterns, O'Reilly Media, Inc. 2004 Ch 7 Adapter and Facade patterns
More informationCSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich
CSCD01 Engineering Large Software Systems Design Patterns Joe Bettridge Winter 2018 With thanks to Anya Tafliovich Design Patterns Design patterns take the problems consistently found in software, and
More informationIngegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1
Ingegneria del Software Corso di Laurea in Informatica per il Management Design Patterns part 1 Davide Rossi Dipartimento di Informatica Università di Bologna Pattern Each pattern describes a problem which
More informationDesign Pattern. CMPSC 487 Lecture 10 Topics: Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, et al.)
Design Pattern CMPSC 487 Lecture 10 Topics: Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, et al.) A. Design Pattern Design patterns represent the best practices used by experienced
More informationThe Strategy Pattern Design Principle: Design Principle: Design Principle:
Strategy Pattern The Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it. Design
More informationUsing Design Patterns in Java Application Development
Using Design Patterns in Java Application Development ExxonMobil Research & Engineering Co. Clinton, New Jersey Michael P. Redlich (908) 730-3416 michael.p.redlich@exxonmobil.com About Myself Degree B.S.
More informationAn Introduction to Patterns
An Introduction to Patterns Robert B. France Colorado State University Robert B. France 1 What is a Pattern? - 1 Work on software development patterns stemmed from work on patterns from building architecture
More informationDESIGN PATTERN - INTERVIEW QUESTIONS
DESIGN PATTERN - INTERVIEW QUESTIONS http://www.tutorialspoint.com/design_pattern/design_pattern_interview_questions.htm Copyright tutorialspoint.com Dear readers, these Design Pattern Interview Questions
More informationProduced by. Design Patterns. MSc in Communications Software. Eamonn de Leastar
Design Patterns MSc in Communications Software Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie
More informationObject-Oriented Design
Object-Oriented Design Lecturer: Raman Ramsin Lecture 20: GoF Design Patterns Creational 1 Software Patterns Software Patterns support reuse of software architecture and design. Patterns capture the static
More informationObject-Oriented Design
Object-Oriented Design Lecture 20 GoF Design Patterns Behavioral Department of Computer Engineering Sharif University of Technology 1 GoF Behavioral Patterns Class Class Interpreter: Given a language,
More informationTuesday, October 4. Announcements
Tuesday, October 4 Announcements www.singularsource.net Donate to my short story contest UCI Delta Sigma Pi Accepts business and ICS students See Facebook page for details Slide 2 1 Design Patterns Design
More informationEPL 603 TOPICS IN SOFTWARE ENGINEERING. Lab 6: Design Patterns
EPL 603 TOPICS IN SOFTWARE ENGINEERING Lab 6: Design Patterns Links to Design Pattern Material 1 http://www.oodesign.com/ http://www.vincehuston.org/dp/patterns_quiz.html Types of Design Patterns 2 Creational
More informationCS560. Lecture: Design Patterns II Includes slides by E. Gamma et al., 1995
CS560 Lecture: Design Patterns II Includes slides by E. Gamma et al., 1995 Classification of GoF Design Pattern Creational Structural Behavioural Factory Method Adapter Interpreter Abstract Factory Bridge
More information1 Software Architecture
Some buzzwords and acronyms for today Software architecture Design pattern Separation of concerns Single responsibility principle Keep it simple, stupid (KISS) Don t repeat yourself (DRY) Don t talk to
More informationWhat is Design Patterns?
Paweł Zajączkowski What is Design Patterns? 1. Design patterns may be said as a set of probable solutions for a particular problem which is tested to work best in certain situations. 2. In other words,
More informationApplying the Observer Design Pattern
Applying the Observer Design Pattern Trenton Computer Festival Professional Seminars Michael P. Redlich (908) 730-3416 michael.p.redlich@exxonmobil.com About Myself Degree B.S. in Computer Science Rutgers
More informationDesign Patterns. Dr. Rania Khairy. Software Engineering and Development Tool
Design Patterns What are Design Patterns? What are Design Patterns? Why Patterns? Canonical Cataloging Other Design Patterns Books: Freeman, Eric and Elisabeth Freeman with Kathy Sierra and Bert Bates.
More informationThe GoF Design Patterns Reference
The GoF Design Patterns Reference Version.0 / 0.0.07 / Printed.0.07 Copyright 0-07 wsdesign. All rights reserved. The GoF Design Patterns Reference ii Table of Contents Preface... viii I. Introduction....
More informationApplication Architectures, Design Patterns
Application Architectures, Design Patterns Martin Ledvinka martin.ledvinka@fel.cvut.cz Winter Term 2017 Martin Ledvinka (martin.ledvinka@fel.cvut.cz) Application Architectures, Design Patterns Winter Term
More informationSYLLABUS CHAPTER - 1 [SOFTWARE REUSE SUCCESS FACTORS] Reuse Driven Software Engineering is a Business
Contents i UNIT - I UNIT - II UNIT - III CHAPTER - 1 [SOFTWARE REUSE SUCCESS FACTORS] Software Reuse Success Factors. CHAPTER - 2 [REUSE-DRIVEN SOFTWARE ENGINEERING IS A BUSINESS] Reuse Driven Software
More informationDesign Patterns Reid Holmes
Material and some slide content from: - Head First Design Patterns Book - GoF Design Patterns Book Design Patterns Reid Holmes GoF design patterns $ %!!!! $ "! # & Pattern vocabulary Shared vocabulary
More informationSlide 1. Design Patterns. Prof. Mirco Tribastone, Ph.D
Slide 1 Design Patterns Prof. Mirco Tribastone, Ph.D. 22.11.2011 Introduction Slide 2 Basic Idea The same (well-established) schema can be reused as a solution to similar problems. Muster Abstraktion Anwendung
More informationIntroduction to Software Engineering: Object Design I Reuse & Patterns
Introduction to Software Engineering: Object Design I Reuse & Patterns John T. Bell Department of Computer Science University of Illinois, Chicago Based on materials from Bruegge & DuToit 3e, Chapter 8,
More informationAn Introduction to Patterns
An Introduction to Patterns Robert B. France Colorado State University Robert B. France 1 What is a Pattern? Patterns are intended to capture the best available software development experiences in the
More informationDesign Patterns. Hausi A. Müller University of Victoria. Software Architecture Course Spring 2000
Design Patterns Hausi A. Müller University of Victoria Software Architecture Course Spring 2000 1 Motivation Vehicle for reasoning about design or architecture at a higher level of abstraction (design
More informationDesign Patterns. Gunnar Gotshalks A4-1
Design Patterns A4-1 On Design Patterns A design pattern systematically names, explains and evaluates an important and recurring design problem and its solution Good designers know not to solve every problem
More information3 Product Management Anti-Patterns by Thomas Schranz
3 Product Management Anti-Patterns by Thomas Schranz News Read above article, it s good and short! October 30, 2014 2 / 3 News Read above article, it s good and short! Grading: Added explanation about
More informationDesign patterns. OOD Lecture 6
Design patterns OOD Lecture 6 Next lecture Monday, Oct 1, at 1:15 pm, in 1311 Remember that the poster sessions are in two days Thursday, Sep 27 1:15 or 3:15 pm (check which with your TA) Room 2244 + 2245
More informationCSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich
CSCD01 Engineering Large Software Systems Design Patterns Joe Bettridge Winter 2018 With thanks to Anya Tafliovich Design Patterns Design patterns take the problems consistently found in software, and
More informationKeywords: Abstract Factory, Singleton, Factory Method, Prototype, Builder, Composite, Flyweight, Decorator.
Comparative Study In Utilization Of Creational And Structural Design Patterns In Solving Design Problems K.Wseem Abrar M.Tech., Student, Dept. of CSE, Amina Institute of Technology, Shamirpet, Hyderabad
More informationDesign Pattern What is a Design Pattern? Design Pattern Elements. Almas Ansari Page 1
What is a Design Pattern? Each pattern Describes a problem which occurs over and over again in our environment,and then describes the core of the problem Novelists, playwrights and other writers rarely
More informationDesign patterns generic models
Design patterns generic models Jyothish Maniyath CDC Software India Pvt Ltd 6 th Floor, Canberra Block, UB City, #24 Vittal Mallya Road, Bangalore, India +91 94482 46718 jyosh@maniyath.com ABSTRACT This
More informationCS/CE 2336 Computer Science II
CS/CE 2336 Computer Science II UT D Session 20 Design Patterns An Overview 2 History Architect Christopher Alexander coined the term "pattern" circa 1977-1979 Kent Beck and Ward Cunningham, OOPSLA'87 used
More informationObject Oriented Paradigm
Object Oriented Paradigm Ming-Hwa Wang, Ph.D. Department of Computer Engineering Santa Clara University Object Oriented Paradigm/Programming (OOP) similar to Lego, which kids build new toys from assembling
More informationCS251 Software Engineering Lectures 18: Intro to DP
و ابتغ فيما آتاك هللا الدار اآلخرة و ال تنس نصيبك من الدنيا CS251 Software Engineering Lectures 18: Intro to DP Slides by Rick Mercer, Christian Ratliff, Oscar Nierstrasz and others 1 Outline Introduction
More informationCSCI Object Oriented Design: Frameworks and Design Patterns George Blankenship. Frameworks and Design George Blankenship 1
CSCI 6234 Object Oriented Design: Frameworks and Design Patterns George Blankenship Frameworks and Design George Blankenship 1 Background A class is a mechanisms for encapsulation, it embodies a certain
More informationApplying the Decorator Design Pattern
Applying the Decorator Design Pattern Trenton Computer Festival Professional Seminars Michael P. Redlich (908) 730-3416 michael.p.redlich@exxonmobil.com About Myself Degree B.S. in Computer Science Rutgers
More informationDesign Patterns (Composite)
CS 247: Software Engineering Principles Design Patterns (Composite) Reading: Freeman, Robson, Bates, Sierra, Head First Design Patterns, O'Reilly Media, Inc. 2004 Ch 9: Composite and Iterator Patterns
More informationApplying Design Patterns to SCA Implementations
Applying Design Patterns to SCA Implementations Adem ZUMBUL (TUBITAK-UEKAE, ademz@uekae.tubitak.gov.tr) Tuna TUGCU (Bogazici University, tugcu@boun.edu.tr) SDR Forum Technical Conference, 26-30 October
More informationObject-oriented Software Design Patterns
Object-oriented Software Design Patterns Concepts and Examples Marcelo Vinícius Cysneiros Aragão marcelovca90@inatel.br Topics What are design patterns? Benefits of using design patterns Categories and
More informationPatterns. Erich Gamma Richard Helm Ralph Johnson John Vlissides
Patterns Patterns Pattern-based engineering: in the field of (building) architecting and other disciplines from 1960 s Some software engineers also started to use the concepts Become widely known in SE
More informationDesign Patterns. SE3A04 Tutorial. Jason Jaskolka
SE3A04 Tutorial Jason Jaskolka Department of Computing and Software Faculty of Engineering McMaster University Hamilton, Ontario, Canada jaskolj@mcmaster.ca November 18/19, 2014 Jason Jaskolka 1 / 35 1
More informationToday's Agenda. References. Open Closed Principle. CS 247: Software Engineering Principles. Object-Oriented Design Principles
CS 247: Software Engineering Principles Reading: none Object-Oriented Design Principles Today's Agenda Object-Oriented Design Principles - characteristics, properties, and advice for making decisions that
More informationModellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico
Modellistica Medica Maria Grazia Pia INFN Genova Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico 2002-2003 Lezione 8 OO modeling Design Patterns Introduction Creational Patterns Software
More informationModellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico
Modellistica Medica Maria Grazia Pia INFN Genova Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico 2002-2003 Lezione 9 OO modeling Design Patterns Structural Patterns Behavioural Patterns
More informationLectures 24 and 25 Introduction to Architectural Styles and Design Patterns
Lectures 24 and 25 Introduction to Architectural Styles and Design Patterns Software Engineering ITCS 3155 Fall 2008 Dr. Jamie Payton Department of Computer Science University of North Carolina at Charlotte
More informationTrusted Components. Reuse, Contracts and Patterns. Prof. Dr. Bertrand Meyer Dr. Karine Arnout
1 Last update: 2 November 2004 Trusted Components Reuse, Contracts and Patterns Prof. Dr. Bertrand Meyer Dr. Karine Arnout 2 Lecture 5: Design patterns Agenda for today 3 Overview Benefits of patterns
More informationadministrivia today UML start design patterns Tuesday, September 28, 2010
administrivia Assignment 2? promise to get past assignment 1 back soon exam on monday review slides are posted your responsibility to review covers through last week today UML start design patterns 1 Unified
More informationGoals of Lecture. Lecture 27: OO Design Patterns. Pattern Resources. Design Patterns. Cover OO Design Patterns. Pattern Languages of Programming
Goals of Lecture Lecture 27: OO Design Patterns Cover OO Design Patterns Background Examples Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2001 April 24, 2001 Kenneth
More informationInformation systems modelling UML and service description languages
Internet Engineering Tomasz Babczyński, Zofia Kruczkiewicz Tomasz Kubik Information systems modelling UML and service description languages Overview of design patterns for supporting information systems
More informationTopics in Object-Oriented Design Patterns
Software design Topics in Object-Oriented Design Patterns Material mainly from the book Design Patterns by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides; slides originally by Spiros Mancoridis;
More information2.1 Design Patterns and Architecture (continued)
MBSE - 2.1 Design Patterns and Architecture 1 2.1 Design Patterns and Architecture (continued) 1. Introduction 2. Model Construction 2.1 Design Patterns and Architecture 2.2 State Machines 2.3 Timed Automata
More informationCSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich
CSCD01 Engineering Large Software Systems Design Patterns Joe Bettridge Winter 2018 With thanks to Anya Tafliovich Design Patterns Design patterns take the problems consistently found in software, and
More information2.1 Design Patterns and Architecture (continued)
MBSE - 2.1 Design Patterns and Architecture 1 2.1 Design Patterns and Architecture (continued) 1. Introduction 2. Model Construction 2.1 Design Patterns and Architecture 2.2 State Machines 2.3 Abstract
More informationA Reconnaissance on Design Patterns
A Reconnaissance on Design Patterns M.Chaithanya Varma Student of computer science engineering, Sree Vidhyanikethan Engineering college, Tirupati, India ABSTRACT: In past decade, design patterns have been
More informationReview Software Engineering October, 7, Adrian Iftene
Review Software Engineering October, 7, 2013 Adrian Iftene adiftene@info.uaic.ro Software engineering Basics Definition Development models Development activities Requirement analysis Modeling (UML Diagrams)
More informationCSCI 253. Overview. The Elements of a Design Pattern. George Blankenship 1. Object Oriented Design: Template Method Pattern. George Blankenship
CSCI 253 Object Oriented Design: George Blankenship George Blankenship 1 Creational Patterns Singleton Abstract factory Factory Method Prototype Builder Overview Structural Patterns Composite Façade Proxy
More informationDesign patterns. Jef De Smedt Beta VZW
Design patterns Jef De Smedt Beta VZW Who Beta VZW www.betavzw.org Association founded in 1993 Computer training for the unemployed Computer training for employees (Cevora/Cefora) 9:00-12:30 13:00-16:00
More informationWhat is Design Patterns?
Paweł Zajączkowski What is Design Patterns? 1. Design patterns may be said as a set of probable solutions for a particular problem which is tested to work best in certain situations. 2. In other words,
More informationbe used for more than one use case (for instance, for use cases Create User and Delete User, one can have one UserController, instead of two separate
UNIT 4 GRASP GRASP: Designing objects with responsibilities Creator Information expert Low Coupling Controller High Cohesion Designing for visibility - Applying GoF design patterns adapter, singleton,
More informationCHAPTER 6: CREATIONAL DESIGN PATTERNS
CHAPTER 6: CREATIONAL DESIGN PATTERNS SESSION III: BUILDER, PROTOTYPE, SINGLETON Software Engineering Design: Theory and Practice by Carlos E. Otero Slides copyright 2012 by Carlos E. Otero For non-profit
More informationMVC. Model-View-Controller. Design Patterns. Certain programs reuse the same basic structure or set of ideas
MVC -- Design Patterns Certain programs reuse the same basic structure or set of ideas These regularly occurring structures have been called Design Patterns Design Patterns Design Patterns: Elements of
More informationIdioms and Design Patterns. Martin Skogevall IDE, Mälardalen University
Idioms and Design Patterns Martin Skogevall IDE, Mälardalen University 2005-04-07 Acronyms Object Oriented Analysis and Design (OOAD) Object Oriented Programming (OOD Software Design Patterns (SDP) Gang
More informationSocket attaches to a Ratchet. 2) Bridge Decouple an abstraction from its implementation so that the two can vary independently.
Gang of Four Software Design Patterns with examples STRUCTURAL 1) Adapter Convert the interface of a class into another interface clients expect. It lets the classes work together that couldn't otherwise
More informationLecture 20: Design Patterns II
Lecture 20: Design Patterns II Software System Design and Implementation ITCS/ITIS 6112/8112 001 Fall 2008 Dr. Jamie Payton Department of Computer Science University of North Carolina at Charlotte Nov.
More informationObject-Oriented Oriented Programming
Object-Oriented Oriented Programming Composite Pattern CSIE Department, NTUT Woei-Kae Chen Catalog of Design patterns Creational patterns Abstract Factory, Builder, Factory Method, Prototype, Singleton
More informationdesign patterns FOR B.tech (jntu - hyderabad & kakinada) (IV/I - CSE AND IV/II - IT) CONTENTS 1.1 INTRODUCTION TO DESIGN PATTERNS TTERNS... TTERN?...
Contents i design patterns FOR B.tech (jntu - hyderabad & kakinada) (IV/I - CSE AND IV/II - IT) CONTENTS UNIT - I [CH. H. - 1] ] [INTRODUCTION TO ]... 1.1-1.32 1.1 INTRODUCTION TO... 1.2 1.2 WHAT T IS
More informationSoftware Reengineering Refactoring To Patterns. Martin Pinzger Delft University of Technology
Software Reengineering Refactoring To Patterns Martin Pinzger Delft University of Technology Outline Introduction Design Patterns Refactoring to Patterns Conclusions 2 The Reengineering Life-Cycle (1)
More informationSoftware Design COSC 4353/6353 D R. R A J S I N G H
Software Design COSC 4353/6353 D R. R A J S I N G H Design Patterns What are design patterns? Why design patterns? Example DP Types Toolkit, Framework, and Design Pattern A toolkit is a library of reusable
More informationUNIT I Introduction to Design Patterns
SIDDHARTH GROUP OF INSTITUTIONS :: PUTTUR Siddharth Nagar, Narayanavanam Road 517583 QUESTION BANK (DESCRIPTIVE) Subject with Code : Design Patterns (16MC842) Year & Sem: III-MCA I-Sem Course : MCA Regulation:
More informationTopics. Software Process. Agile. Requirements. Basic Design. Modular Design. Design Patterns. Testing. Quality. Refactoring.
CS310 - REVIEW Topics Process Agile Requirements Basic Design Modular Design Design Patterns Testing Quality Refactoring UI Design How these things relate Process describe benefits of using a software
More informationFacade and Adapter. Comp-303 : Programming Techniques Lecture 19. Alexandre Denault Computer Science McGill University Winter 2004
Facade and Adapter Comp-303 : Programming Techniques Lecture 19 Alexandre Denault Computer Science McGill University Winter 2004 March 23, 2004 Lecture 19 Comp 303 : Facade and Adapter Page 1 Last lecture...
More informationSoftware Eningeering. Lecture 9 Design Patterns 2
Software Eningeering Lecture 9 Design Patterns 2 Patterns covered Creational Abstract Factory, Builder, Factory Method, Prototype, Singleton Structural Adapter, Bridge, Composite, Decorator, Facade, Flyweight,
More informationAPPLYING DESIGN PATTERNS TO SCA IMPLEMENTATIONS
APPLYING DESIGN PATTERNS TO SCA IMPLEMENTATIONS Adem Zumbul (TUBITAK-UEKAE, Kocaeli, Turkey, ademz@uekae.tubitak.gov.tr); Tuna Tugcu (Bogazici University, Istanbul, Turkey, tugcu@boun.edu.tr) ABSTRACT
More informationApplying Design Patterns to accelerate development of reusable, configurable and portable UVCs. Accellera Systems Initiative 1
Applying Design Patterns to accelerate development of reusable, configurable and portable UVCs. Accellera Systems Initiative 1 About the presenter Paul Kaunds Paul Kaunds is a Verification Consultant at
More informationDesign Patterns Lecture 2
Design Patterns Lecture 2 Josef Hallberg josef.hallberg@ltu.se 1 Patterns covered Creational Abstract Factory, Builder, Factory Method, Prototype, Singleton Structural Adapter, Bridge, Composite, Decorator,
More informationApplying Some Gang of Four Design Patterns CSSE 574: Session 5, Part 3
Applying Some Gang of Four Design Patterns CSSE 574: Session 5, Part 3 Steve Chenoweth Phone: Office (812) 877-8974 Cell (937) 657-3885 Email: chenowet@rose-hulman.edu Gang of Four (GoF) http://www.research.ibm.com/designpatterns/pubs/ddj-eip-award.htm
More informationAppendix-A. A.1 Catalogues of Design Patterns. Below is the definition for each design pattern using the FINDER notation, followed
A Appendix-A A.1 Catalogues of Design Patterns Below is the definition for each design pattern using the FINDER notation, followed by a description of the rules. These definitions have been created using
More informationSoftware Engineering I (02161)
Software Engineering I (02161) Week 10 Assoc. Prof. Hubert Baumeister DTU Compute Technical University of Denmark Spring 2016 Last Time Project Planning Non-agile Agile Refactoring Contents Basic Principles
More informationCSCI 253. Overview. The Elements of a Design Pattern. George Blankenship 1. Object Oriented Design: Iterator Pattern George Blankenship
CSCI 253 Object Oriented Design: Iterator Pattern George Blankenship George Blankenship 1 Creational Patterns Singleton Abstract factory Factory Method Prototype Builder Overview Structural Patterns Composite
More informationPlan. Design principles: laughing in the face of change. What kind of change? What are we trying to achieve?
Plan Design principles: laughing in the face of change Perdita Stevens School of Informatics University of Edinburgh What are we trying to achieve? Review: Design principles you know from Inf2C-SE Going
More informationSoftware Engineering I (02161)
Software Engineering I (02161) Week 8 Assoc. Prof. Hubert Baumeister DTU Compute Technical University of Denmark Spring 2018 Contents Basic Principles of Good Design Design Patterns Low Coupling High coupling
More informationDesign Patterns. CSE870: Advanced Software Engineering (Design Patterns): Cheng
Design Patterns Acknowledgements Materials based on a number of sources D. Levine and D. Schmidt. Helm Gamma et al S. Konrad Motivation Developing software is hard Designing reusable software is more challenging
More informationSOFTWARE PATTERNS. Joseph Bonello
SOFTWARE PATTERNS Joseph Bonello MOTIVATION Building software using new frameworks is more complex And expensive There are many methodologies and frameworks to help developers build enterprise application
More informationA Rapid Overview of UML
A Rapid Overview of UML The Unified dmodeling Language (UML) Emerged in the mid 90s as the de facto standard for softwareengineering engineering design Use case diagram depicts user interaction with system
More informationA Primer on Design Patterns
A Primer on Design Patterns First Edition Rahul Batra This book is for sale at http://leanpub.com/aprimerondesignpatterns This version was published on 2016-03-23 This is a Leanpub book. Leanpub empowers
More informationDesign Patterns! Acknowledgements!
Design Patterns! Acknowledgements! Materials based on a number of sources! D. Levine and D. Schmidt!. Helm! Gamma et al! S. Konrad! (Cheng) 1 Motivation! Developing software is hard! Designing reusable
More informationCreational Design Patterns
Creational Design Patterns Creational Design Patterns Structural Design Patterns Behavioral Design Patterns GoF Design Pattern Categories Purpose Creational Structural Behavioral Scope Class Factory Method
More informationA few important patterns and their connections
A few important patterns and their connections Perdita Stevens School of Informatics University of Edinburgh Plan Singleton Factory method Facade and how they are connected. You should understand how to
More informationPlan. A few important patterns and their connections. Singleton. Singleton: class diagram. Singleton Factory method Facade
Plan A few important patterns and their connections Perdita Stevens School of Informatics University of Edinburgh Singleton Factory method Facade and how they are connected. You should understand how to
More informationEgon Borger (Pisa) Capturing Design Pattern Abstractions by ASMs
Egon Borger (Pisa) Capturing Design Pattern Abstractions by ASMs Universita di Pisa, Dipartimento di Informatica, I-56127 Pisa, Italy boerger@di.unipi.it visiting SAP Research, Karlsruhe, Germany egon.boerger@sap.com
More information