CS 2720 Practical Software Development University of Lethbridge. Design Patterns
|
|
- Tamsin James
- 6 years ago
- Views:
Transcription
1 Design Patterns A design pattern is a general solution to a particular class of problems, that can be reused. They are applicable not just to design. You can think of patterns as another level of abstraction. It is a solution that can be easily translated into code. Typically not built into the language. Design Patterns 1 48 Howard Cheng
2 Types of Design Patterns Creational: how an object can be created Structural: the way objects are connected with each other Behavioral: objects that handle particular types of actions within a program. Design Patterns 2 48 Howard Cheng
3 The Singleton Pattern Used to restrict one and only one instance of a class. They are preferred to global variables because of namespace pollution and lazy allocation. A class would use a static method to create an object if there is not already an instance, or return a reference to the single object. Disallow (copy) constructor and assignment operator. Allocate static object inside getinstance() function. Example usage: central manager (e.g. window manager), log file, Builder objects. Design Patterns 3 48 Howard Cheng
4 The Singleton Pattern Singleton static uniqueinstance: singletondata static Instance() SingletonOperation() GetSingletonData() return uniqueinstance Design Patterns 4 48 Howard Cheng
5 The Factory Pattern If you use polymorphism to create new classes, new types can be added without disturbing much existing code... except when you create the objects Solution: force the creation of objects to occur through a common factory. The factory method can be a virtual function in the base class. A separate factory class can also be created to create the appropriate objects given a parameter. Design Patterns 5 48 Howard Cheng
6 The Factory Pattern Framework Document Application CreateDocument() newdocument() Document* doc = CreateDocument(); // add doc to container Application MyDocument MyApplication CreateDocument() return new MyDocument() Design Patterns 6 48 Howard Cheng
7 The Abstract Factory Pattern Encapsulates a group of similar factories. The client creates a concrete implementation of abstract factory and use the abstract interface. The client does not know which object is created. Allows concrete classes to be changed without changing the client code. e.g. create a window in different windowing environment. Design Patterns 7 48 Howard Cheng
8 The Abstract Factory Pattern <<interface>> AbstractFactory CreateProductA() CreateProductB() Client AbstractProductA AbstractProductB ConcreteFactory1 CreateProductA() CreateProductB() ConcreteFactory2 CreateProductA() CreateProductB() ProductA1 ProductA2 ProductB1 ProductB2 Design Patterns 8 48 Howard Cheng
9 The Builder Pattern The builder pattern is used to build objects. A builder class tries to build an object one step at a time (through composition). A director class is responsible for managing the correct sequence of steps of object creation. For example: building a car from its parts. Design Patterns 9 48 Howard Cheng
10 The Builder Pattern RTFReader Parse() DocumentConverter ConvertParagraph( :char) ConvertFont( :Font) ConvertParagraph() while (t = get_next_token()) { switch(t.type) case CHAR: builder->convertcharacter(t.aschar) break case FONT: builder->convertfontchange(t.asfont) break case PARAGRAPH: builder->convertparagraph() } AsciiConverter AsciiDocument TexConverter TexDocument HtmlConverter HtmlDocument Design Patterns Howard Cheng
11 The Prototype Pattern Sometimes we want to create objects based on a prototype object which is then cloned to produce new objects. Avoids subclasses of object creator (e.g. abstract factory). An abstract base class specifies a pure virtual clone() method. Useful when there are only a few different possible values for objects. This is kind of a polymorphic constructor. A factory method can be used in combination to create objects from prototypes from different classes. Design Patterns Howard Cheng
12 The Prototype Pattern Client Operation() Prototype Clone() p = prototype->clone() ConcretePrototype1 Clone() ConcretePrototype2 Clone() Design Patterns Howard Cheng
13 The Adapter Pattern The adapter pattern is a way to wraparound some classes to provide an interface expected by some other class. The adapter may also transform input/output data into the right forms. The target is how you want to use the class. The adaptee is the underlying class. e.g. string stream, stream iterator Design Patterns Howard Cheng
14 The Adapter Pattern Client Target Request() Adaptee SpecificRequest() Adapter Request() SpecificRequest() Design Patterns Howard Cheng
15 The Bridge Pattern This pattern is used to decouple an abstraction from its implementation, so that the two can vary independently. If only the class may vary, then inheritance is good enough. But if the behavior of the class may also vary, using inheritance may result in too many classes with duplicated code. For example, different Shapes that can be drawn differently depending on the graphical user interface. Design Patterns Howard Cheng
16 The Bridge Pattern 3DShape Draw() Cube Prism Pyramid CubeDX CubeOGL PrismDX PrismOGL PyramidDX PyramidOGL DirectX OpenGL Design Patterns Howard Cheng
17 The Bridge Pattern One inheritance tree is used for the classes. Another tree is used to handle the different implementation (behavior). The abstract base class has a reference (or owns) the abstract base of the implementation class. The right function is triggered automatically by polymorphism. Design Patterns Howard Cheng
18 The Bridge Pattern 3DShape Draw() DrawLine() 3DImplementation Cube Prism Pyramid DXImplementation OGLImplementation DirectX OpenGL Design Patterns Howard Cheng
19 The Composite Pattern Sometimes we want to perform the same command to a group of objects. These commands often can be applied to a single object as well. e.g. deleting a single message vs. deleting a group of message. It may be useful if a group of object can be treated in exactly the same way as a single instance of an object. The composite pattern use tree structures to represent part-whole hierarchies. A abstract base class is used to model each component, which can either be a leaf or a composite class. Each component supports an operation (e.g. delete). The client can invoke the operation from the component for the whole group. Design Patterns Howard Cheng
20 The Composite Pattern Component Client Operation() Add(c:Component) Remove(c:Component) GetChild(i:int) child Leaf Operation() Composite Operation() for all c:child c->operation() Design Patterns Howard Cheng
21 The Decorator Pattern Allows functionality of a class to be extended at runtime. A new decorator class wraps the original class. Decorator takes an object of original class in constructor. Decorator implements new functionalities, but must have the same interface as original class. Inheritance adds new behaviour at compile time. e.g. GUI: add scrollbars, borders, etc. to windows, adding access control to users. Design Patterns Howard Cheng
22 The Decorator Pattern Component Operation() ConcreteComponent Decorator Operation() component->operation() ConcreteDecoratorA addedstate Operation() ConcreteDecoratorB Operation() AddedBehaviour() Decorator::Operation() AddedBehaviour() Design Patterns Howard Cheng
23 The Façade Pattern Used to provide a simpler interface for a large body of code. Reduce dependencies of inner workings of a library. e.g. database, compiler, etc. Design Patterns Howard Cheng
24 The Flyweight Pattern Often, an application needs to use a large number of similar objects. e.g. a drawing application may need to use a large number of Pen objects to specify how each object is to be drawn (e.g. colour, thickness, etc.). The states of these objects can often be shared (e.g. there may only be a few different colours). A flyweight is an object that is shared by many other objects to minimize memory usage. The state is divided into intrinsic state (the common part) and extrinsic state (the rest). e.g. intrinsic: pen colour, thickness, etc. extrinsic: endpoints of line A factory method creates a required flyweight object if it does not already exist, and return a reference to it. Design Patterns Howard Cheng
25 The Flyweight Pattern FlyweightFactory getflyweight(key) Flyweight Operation(es:ExtrinsecState) State if(flyweight[key] exists) { return existing flyweight } else{ create new flyweight add it to pool return the new flyweight } Client ConcreteFlyweight is:intrinsecstate ConcreteUnsharedFlyweight as:allstate IntrinsecState ExtrinsecState Design Patterns Howard Cheng
26 The Proxy Pattern A proxy is a class acting as an interface to something else. Can be used to encapsulate file, network, GUI, etc. One base class for common interface. One real implementation as subclass. One proxy implementation to delegate to the real implementation. Can be used to defer creation of objects until needed. e.g. smart pointers. Design Patterns Howard Cheng
27 The Proxy Pattern Client Subject Request() RealSubject Request() Proxy Request() realsubject->request Design Patterns Howard Cheng
28 The Chain of Responsibility Pattern A set of processing objects that describes what command objects it can handle, and how to pass off those it cannot handle. Allows the client to send a request to only one chain instead of a specific object decouples a request sender and receiver. The first processing object that can handle the command will do it. e.g. help button: the request is passed from the most limiting component (e.g. button) up the chain until one can handle it. Every class has a single responsibility. The chain can be constructed at run time. Design Patterns Howard Cheng
29 The Chain of Responsibility Pattern HelpHandler handlehelp() handler handler->handlehelp() Application Widget Dialog Button handlehelp() showhelp() if(can handle) { showhelp(); }else{ handler->handlehelp(); } Design Patterns Howard Cheng
30 The Command Pattern Command Objects are used to encapsulate actions and their parameters. Examples: PrintJob, TestRunner. The command class may have an execute() or run() method. Similar to function pointers, but can store extra parameters. Can collect command objects to execute them in sequence. Allows one to treat all commands in a similar way (execute(), undo(), getestimatedduration()). Example application: maintaining an undo list (each command class has an undo() method), specifying actions for menu items, queueing jobs. Design Patterns Howard Cheng
31 The Command Pattern Application Menu MenuItem Command add(d:document) add(mi:menuitem) onclick() execute() onclick() { command->execute(); } Document open() close() cut() copy() pastecommand execute() execute() { document->paste(); } OpenCommand execute() execute() { name = askuser() doc = new Document(name); application->add(doc); doc->open(); } Design Patterns Howard Cheng
32 The Interpreter Pattern Use a specialized computer language to solve a restricted class of problems. Have one class for each symbol in the language. It is easy to change and extend the grammar. e.g. calculator language, database query language (SQL), etc. e.g. every class can have a generate code function. Design Patterns Howard Cheng
33 The Iterator Pattern It describes a way to access elements in any container in a sequential manner. The internal representation of the container is not exposed. This is implemented in STL containers. All containers can be accessed in a consistent manner. Design Patterns Howard Cheng
34 The Iterator Pattern Container CreateIterator() Append(i:Item) Client Iterator First() Next() isdone() CurrentItem() List Vector ListIterator VectorIterator First() Next() isdone() CurrentItem() Design Patterns Howard Cheng
35 The Mediator Pattern Provides a unified interface to a set of interfaces in a subsystem. Communication between objects is encapsulated with a mediator object. Lower coupling. Mediator: defines interface for communication between colleagues ConcreteMediator: implements the Mediator interface and coordinates communication. ConcreteColleague: communicates with other colleagues through its mediator. e.g. many components in a GUI dialog may have to interact with each other selecting one component may require an update of another component. Design Patterns Howard Cheng
36 The Mediator Pattern EntryField RadioBox RadioBox ListBox RadioBox FontDialogDirector EntryField RadioBox ListBox Button vs. Button Design Patterns Howard Cheng
37 The Memento Pattern This pattern provides the ability for an object to restore itself to a previous state. The originator is the object of interest. A caretaker wants to perform an operation on the originator, and asks it for a memento object first. The memento object can be used to restore the orignator s state. The memento object cannot be examined by anyone other than the originator. e.g. random number generator, finite state machine. Design Patterns Howard Cheng
38 The Memento Pattern Originator SetMementor(Memento m) CreateMemento() state return new Memento(state) state = m->getstate() Memento GetState() SetState() state CareTaker Design Patterns Howard Cheng
39 The Observer Pattern An object maintains a list of dependents and notifies them automatically of any state change. The notification is done by calling a method from the dependent. Each dependent is an observer, and should have an update() method. A subject allows each observer to attach and detach itself. The subject is responsible for notifying the observers when a change has occurred. e.g. GUI views: when the underlying data has changed, the GUI has to be informed to be redrawn. Design Patterns Howard Cheng
40 The Observer Pattern Subject Attach(o:Observer) Detach(o:Observer) Notify() <<interface>> Observer Update() forall o in observer o->update() ConcreteSubject subjectstate GetState() SetState() subject#1 ConcreteObserver observerstate Update() observerstate = subject->getstate() return subjectstate Design Patterns Howard Cheng
41 The State Pattern The intent is for the class to choose one of the real implementations as appropriate at run time. The choice can change at run time. e.g. Dead/alive for players, drawing tool (different behaviour for mouse click for different tools). Move logic from code into classes. Design Patterns Howard Cheng
42 The State Pattern TCPConnection Open() Close() Acknowledge() TCPState Open() Close() Acknowledge() state->open() TCPEstablished TCPListen TCPClosed Design Patterns Howard Cheng
43 The Strategy/Policy Pattern Sometimes it is useful to dynamically swap the algorithms used in an application. The strategy pattern encapsulates each algorithm as an object and make them interchangeable. Use a polymorphic base class and inherit each algorithm as a subclass. A wrapper context class is used to hold a pointer to the base class, and provides a way to set a particular algorithm. Design Patterns Howard Cheng
44 The Strategy Pattern Sorter MethodWithSort() Sort Sort() sort->sort() QuickSort HeapSort NaiveSort Design Patterns Howard Cheng
45 The Template Method Pattern Useful for modelling a related set of algorithms. Each algorithm is encapsulated as an abstract base class. The steps of the algorithm are implemented as virtual functions. The abstract base class implements the algorithms by calling the virtual functions. Specific variation of algorithms are achieved by deriving from the abstract class and overriding the virtual functions. e.g. two-player game: initialize game, deciding whose turn it is, make a move, deciding end of game, deciding winner. Design Patterns Howard Cheng
46 The Template Method Pattern Document Read() Application CreateDocument() CanOpenDocument() InitializeOpenDocument() OpenDocument() MyDocument Read() MyApplication CanOpenDocument() InitializeOpenDocument() CreateDocument() Design Patterns Howard Cheng
47 The Visitor Pattern Separates an algorithm from an object structure upon which it operates. Each element class has an accept() method which takes a visitor object as a parameter. Visitor is an interface with a visit() method for each element class. The accept() method calls back visit(). Different visitor classes are used to perform different operations. New functionality can be added by defining new visitor classes without changing object structure. Design Patterns Howard Cheng
48 The Visitor Pattern Visitor Node TypeCheck() GenerateCode() Write() TypeCheckingVisitor WritingVisitor VariableReferenceNode AssignementNode OperationNode CodeGeneratingVisitor VisitAssignmentNode(n:AssignmentNode) VisitVariableReferenceNode(n:VariableReferenceNode) VisitOperationNode(n:OperationNode) Program Node AcceptVisitor(v:Visitor) AssignementNode AcceptVisitor(v:Visitor) VariableReferenceNode AcceptVisitor(v:Visitor) v->visitassignementnode(this) v->visitreferencenode(this) Design Patterns Howard Cheng
Brief Note on Design Pattern
Brief Note on Design Pattern - By - Channu Kambalyal channuk@yahoo.com This note is based on the well-known book Design Patterns Elements of Reusable Object-Oriented Software by Erich Gamma et., al.,.
More informationCOSC 3351 Software Design. Design Patterns Behavioral Patterns (I)
COSC 3351 Software Design Design Patterns Behavioral Patterns (I) Spring 2008 Purpose Creational Structural Behavioral Scope Class Factory Method Adapter(class) Interpreter Template Method Object Abstract
More informationDr. Xiaolin Hu. Review of last class
Review of last class Design patterns Creational Structural Behavioral Abstract Factory Builder Factory Singleton etc. Adapter Bridge Composite Decorator Façade Proxy etc. Command Iterator Observer Strategy
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 informationDesign Patterns. Softwaretechnik. Matthias Keil. Albert-Ludwigs-Universität Freiburg
Design Patterns Softwaretechnik Matthias Keil Institute for Computer Science Faculty of Engineering University of Freiburg 6. Mai 2013 Design Patterns Gamma, Helm, Johnson, Vlissides: Design Patterns,
More informationDesign Patterns (II)
Design Patterns (II) Design Pattern Space Defer object creation to another class Scope Class Object Defer object creation to another object Creational Factory Method Abstract Factory Builder Prototype
More informationDesign Patterns. Software Engineering. Sergio Feo-Arenis slides by: Matthias Keil
Design Patterns Software Engineering Sergio Feo-Arenis slides by: Matthias Keil Institute for Computer Science Faculty of Engineering University of Freiburg 30.06.2014 Design Patterns Literature Gamma,
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 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 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 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 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 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 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 informationDesign Patterns. Manuel Mastrofini. Systems Engineering and Web Services. University of Rome Tor Vergata June 2011
Design Patterns Lecture 2 Manuel Mastrofini Systems Engineering and Web Services University of Rome Tor Vergata June 2011 Structural patterns Part 2 Decorator Intent: It attaches additional responsibilities
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 informationLast Lecture. Lecture 17: Design Patterns (part 2) Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 4448/ Spring Semester, 2005
1 Lecture 17: Design Patterns (part 2) Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 4448/6448 - Spring Semester, 2005 2 Last Lecture Design Patterns Background and Core Concepts Examples
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 informationSoftwaretechnik. Design Patterns. Matthias Keil. Albert-Ludwigs-Universität Freiburg
Softwaretechnik Design Patterns Matthias Keil Institute for Computer Science Faculty of Engineering University of Freiburg 14. Juni 2012 Design Patterns (1) solutions for specific problems in object-oriented
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 informationSoftwaretechnik. Design Patterns. Stephan Arlt SS University of Freiburg. Stephan Arlt (University of Freiburg) Softwaretechnik SS / 47
Softwaretechnik Design Patterns Stephan Arlt University of Freiburg SS 2011 Stephan Arlt (University of Freiburg) Softwaretechnik SS 2011 1 / 47 Design Patterns Gamma, Helm, Johnson, Vlissides: Design
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 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 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 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 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 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 information6.3 Patterns. Definition: Design Patterns
Subject/Topic/Focus: Analysis and Design Patterns Summary: What is a pattern? Why patterns? 6.3 Patterns Creational, structural and behavioral patterns Examples: Abstract Factory, Composite, Chain of Responsibility
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 informationEMBEDDED SYSTEMS PROGRAMMING Design Patterns
EMBEDDED SYSTEMS PROGRAMMING 2015-16 Design Patterns DEFINITION Design pattern: solution to a recurring problem Describes the key elements of the problem and the solution in an abstract way Applicable
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 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 informationPage 1. Chapter 8, Object Design: Design Patterns II. Recall: Why reusable Designs? Definitions. A Taxonomy of Design Patterns
Object-Oriented Software Engineering Using UML, Patterns, and Java Chapter 8, Object Design: Design Patterns II Recall: Why reusable Designs? A design enables flexibility to change (reusability) minimizes
More informationEMBEDDED SYSTEMS PROGRAMMING Design Patterns
EMBEDDED SYSTEMS PROGRAMMING 2014-15 Design Patterns DEFINITION Design pattern: solution to a recurring problem Describes the key elements of the problem and the solution in an abstract way Applicable
More informationDesign for change. You should avoid
Design patterns Sources Cours de Pascal Molli «A System of Pattern» Bushmann et All «Design Patterns» Gamma et All (GoF) «Applying UML and Patterns» Larman "Design Patterns Java Workbook" Steven John Metsker
More informationDesign Patterns 2. Page 1. Software Requirements and Design CITS 4401 Lecture 10. Proxy Pattern: Motivation. Proxy Pattern.
Proxy : Motivation Design s 2 It is 3pm. I am sitting at my 10Mbps connection and go to browse a fancy web page from the US, This is prime web time all over the US. So I am getting 100kbps What can you
More informationOODP Session 5a. Web Page: Visiting Hours: Tuesday 17:00 to 19:00
OODP Session 5a Next week: Reading week Session times PT group 1 Monday 18:00 21:00 room: Malet 403 PT group 2 Thursday 18:00 21:00 room: Malet 407 FT Tuesday 13:30 17:00 room: Malet 404 Email: oded@dcs.bbk.ac.uk
More informationGoF Design Pattern Categories
GoF Design Pattern Categories Purpose Creational Structural Behavioral Scope Class Factory Method Adapter Interpreter Template Method Object Abstract Factory Builder Prototype Singleton Adapter Bridge
More informationSecond Midterm Review
Second Midterm Review Comp-303 : Programming Techniques Lecture 24 Alexandre Denault Computer Science McGill University Winter 2004 April 5, 2004 Lecture 24 Comp 303 : Second Midterm Review Page 1 Announcements
More informationDesign of Software Systems (Ontwerp van SoftwareSystemen) Design Patterns Reference. Roel Wuyts
Design of Software Systems (Ontwerp van SoftwareSystemen) Design Patterns Reference 2015-2016 Visitor See lecture on design patterns Design of Software Systems 2 Composite See lecture on design 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 informationIntroduction and History
Pieter van den Hombergh Fontys Hogeschool voor Techniek en Logistiek September 15, 2016 Content /FHTenL September 15, 2016 2/28 The idea is quite old, although rather young in SE. Keep up a roof. /FHTenL
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 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 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 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 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 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 informationDesign Patterns: Structural and Behavioural
Design Patterns: Structural and Behavioural 3 April 2009 CMPT166 Dr. Sean Ho Trinity Western University See also: Vince Huston Review last time: creational Design patterns: Reusable templates for designing
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 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 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 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 informationObject-Oriented Oriented Programming Factory Method Pattern Abstract Factory Pattern. CSIE Department, NTUT Woei-Kae Chen
Object-Oriented Oriented Programming Factory Method Pattern Abstract Factory Pattern CSIE Department, NTUT Woei-Kae Chen Factory Method Pattern Factory Method Pattern Creational pattern Factory Method:
More informationCOSC 3351 Software Design. Design Patterns Behavioral Patterns (II)
COSC 3351 Software Design Design Patterns Behavioral Patterns (II) Spring 2008 Purpose Creational Structural Behavioral Scope Class Factory Method Adapter(class) Interpreter Template Method Object Abstract
More informationDesign Patterns. (and anti-patterns)
Design Patterns (and anti-patterns) Design Patterns The Gang of Four defined the most common object-oriented patterns used in software. These are only the named ones Lots more variations exist Design Patterns
More informationLast Lecture. Lecture 26: Design Patterns (part 2) State. Goals of Lecture. Design Patterns
Lecture 26: Design Patterns (part 2) Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2003 Last Lecture Design Patterns Background and Core Concepts Examples Singleton,
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 informationObject-Oriented Oriented Programming Command Pattern. CSIE Department, NTUT Woei-Kae Chen
Object-Oriented Oriented Programming Command Pattern CSIE Department, NTUT Woei-Kae Chen Command: Intent Encapsulate a request as an object thereby letting you parameterize clients with different requests
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 informationFactory Method. Comp435 Object-Oriented Design. Factory Method. Factory Method. Factory Method. Factory Method. Computer Science PSU HBG.
Comp435 Object-Oriented Design Week 11 Computer Science PSU HBG 1 Define an interface for creating an object Let subclasses decide which class to instantiate Defer instantiation to subclasses Avoid the
More informationCSC207H: Software Design Lecture 6
CSC207H: Software Design Lecture 6 Wael Aboelsaadat wael@cs.toronto.edu http://ccnet.utoronto.ca/20075/csc207h1y/ Office: BA 4261 Office hours: R 5-7 Acknowledgement: These slides are based on material
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 informationTHOMAS LATOZA SWE 621 FALL 2018 DESIGN PATTERNS
THOMAS LATOZA SWE 621 FALL 2018 DESIGN PATTERNS LOGISTICS HW3 due today HW4 due in two weeks 2 IN CLASS EXERCISE What's a software design problem you've solved from an idea you learned from someone else?
More informationCSE870: Advanced Software Engineering (Cheng) 1
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 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 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 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 informationI, J. Key-value observing (KVO), Label component, 32 text property, 39
Index A Abstract factory pattern, 207 concrete factory, 213 examples in Cocoa, 227 groups of objects, 212 implementing, 213 abstract factories, 214 concrete factories, 214 215 operations, 212 213 pitfalls,
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 informationAbstract Factory. Consequences section. UML structure. Applicability section Requirement Elaboration of requirement Achieved through
Abstract Factory a system should be independent of how its products are created, composed, and represented. a family of related product objects is designed to be used together, and you need to enforce
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 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 informationCreational Patterns for Variability
Creational Patterns for Variability Prof. Dr. U. Aßmann Chair for Software Engineering Faculty of Informatics Dresden University of Technology Version 06-1.4, Oct 30, 2006 Design Patterns and Frameworks,
More informationLecture 17: Patterns Potpourri. Copyright W. Howden 1
Lecture 17: Patterns Potpourri Copyright W. Howden 1 GOF Patterns GOF: Gamma, Helm, Johnson, Vlissides Design Patterns, Addison Wesley, 1995 Patterns we have seen so far Creational Patterns e.g. Factory,
More informationCSC 301H, Introduction to Software Engineering
CSC 301H, Introduction to Software Engineering Presented by Soheil Hassas Yeganeh Slides By Golnaz Elahi Outline Design Pattern Concept Types of Design Patterns Overview of some Patterns: Abstract Factory
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 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 informationTDDB84: Lecture 6. Adapter, Bridge, Observer, Chain of Responsibility, Memento, Command. fredag 4 oktober 13
TDDB84: Lecture 6 Adapter, Bridge, Observer, Chain of Responsibility, Memento, Command Creational Abstract Factory Singleton Builder Structural Composite Proxy Bridge Adapter Template method Behavioral
More informationThe Design Patterns Matrix From Analysis to Implementation
The Design Patterns Matrix From Analysis to Implementation This is an excerpt from Shalloway, Alan and James R. Trott. Design Patterns Explained: A New Perspective for Object-Oriented Design. Addison-Wesley
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 informationComposite Pattern. IV.4 Structural Pattern
IV.4 Structural Pattern Motivation: Compose objects to realize new functionality Flexible structures that can be changed at run-time Problems: Fixed class for every composition is required at compile-time
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 informationOverview CS Kinds of Patterns. Design Pattern. Factory Pattern Rationale. Kinds of Factory Patterns
Overview CS 2704 Topic: Design Patterns Design pattern concepts Kinds of patterns Some specific patterns Pattern resources 5/1/00 CS2704 Design Patterns 2 Design Pattern Solution to a particular kind of
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 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 informationDESIGN PATTERNS MOCK TEST DESIGN PATTERNS MOCK TEST II
http://www.tutorialspoint.com DESIGN PATTERNS MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to Design Patterns Framework. You can download these sample
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 informationSoftware Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns
Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns Today we are going to talk about an important aspect of design that is reusability of design. How much our old design
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 informationReview of last class. 1.Class inheritance versus interface inheritance 2.Inheritance versus composition. Dr. Xiaolin Hu
Review of last class 1.Class inheritance versus interface inheritance 2.Inheritance versus composition Design patterns Creational Structural Behavioral Abstract Factory Builder Prototype Singleton etc.
More informationDesign patterns Behavioral Pattern 2015
Behavioral Patterns Behavioral patterns are concerned with algorithms and the assignment of responsibilities between objects. Behavioral patterns describe not just patterns of objects or classes but also
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 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 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 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 informationPro Objective-C Design Patterns for ios
Pro Objective-C Design Patterns for ios Carlo Chung Contents Contents at a Glance About the Author About the Technical Reviewer Acknowledgments Preface x xi xii xiii Part I: Getting Your Feet Wet 1 Chapter
More informationCreational Patterns. Factory Method (FM) Abstract Factory (AF) Singleton (SI) Prototype (PR) Builder (BU)
Creational Patterns Creational Patterns Factory Method (FM) Abstract Factory (AF) Singleton (SI) Prototype (PR) Builder (BU) Factory Method (FM) Intent: Define an interface for creating an object, but
More informationJava Technologies. Lecture III. Valdas Rapševičius. Vilnius University Faculty of Mathematics and Informatics
Preparation of the material was supported by the project Increasing Internationality in Study Programs of the Department of Computer Science II, project number VP1 2.2 ŠMM-07-K-02-070, funded by The European
More information