SOFTWARE PATTERNS. Joseph Bonello
|
|
- Sharon Alexander
- 6 years ago
- Views:
Transcription
1 SOFTWARE PATTERNS Joseph Bonello
2 MOTIVATION Building software using new frameworks is more complex And expensive There are many methodologies and frameworks to help developers build enterprise application
3 MOTIVATION The main problems are: Changes in business logic Technology updates Maintenance Building software is difficult Building reusable software is even harder!
4 WHY PATTERNS? We need a common, tried-and-tested way of building and testing software Especially in those areas where common problems recur The aim is to make it easier to change and maintain software Other aims Developers adopt a common design principle Don t waste time hacking your way into a solution Reference on structures that get the work done efficiently
5 PATTERNS AND ANTI-PATTERNS A pattern is a general, re-usable solution to a common problem in software design Gamma, Erich; Richard Helm, Ralph Johnson, and John Vlissides (1995). Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley. ISBN (Gang-Of-Four Book)
6 PATTERNS AND ANTI-PATTERNS An anti-pattern is a commonly used pattern but is counterproductive or ineffective in practice Experienced OO designers, in general, do not try to solve a problem from first principles Instead, they prefer to reuse a solution that has worked in the past
7 WHAT CONSTITUTES A PATTERN? A Pattern has 4 essential elements: A pattern name: Used to refer to a description of a design problem, its solutions and consequences using a descriptive alias. The alias allows us to communicate with other and design at a higher level of abstraction. The problem: It describes when to apply the pattern. It describes the context of the problem such as class/object structures symptomatic of bad design or a list of conditions that must be met before applying the pattern.
8 WHAT CONSTITUTES A PATTERN? A Pattern has 4 essential elements: The solution: describes the elements that make up the design, the relationships, responsibilities and collaborations. It does not describe a concrete implementation. It is an abstract description of the general arrangement that will solve the problem. The consequences: refer to the results and trade-offs or applying the pattern. They are used to judge the costs and benefits of applying the pattern. Consequences include impact on system flexibility, extensibility and portability.
9 CATEGORIES OF PATTERNS Creational patterns Deal with object creation mechanisms Structural patterns Ease the design of defining relationships between entities Behavioral patterns Used to identify communication patterns between objects and increase flexibility when carrying out this communication
10 CREATIONAL PATTERNS We shall be looking at the following Creational Patterns Singleton Pattern Abstract Factory (Kit) Pattern
11 THE SINGLETON PATTERN IA Provides a single object throughout the lifetime of an application Provides a single access point to the object
12 THE SINGLETON PATTERN IB An example would be to have one database connection per client application Used when: There must only be one instance of a class Clients need one single way of accessing the instance
13 THE SINGLETON PATTERN II Benefits: Controlled access to sole instance (or multiple instances) Avoids global variables in namespace Permits Subclassing More flexible than static member and methods
14 SINGLETON PATTERN III public class ClassicSingleton { private static ClassicSingleton instance = null; protected ClassicSingleton() { // Exists only to defeat instantiation. public static ClassicSingleton getinstance() { if(instance == null) { instance = new ClassicSingleton(); return instance;
15 SINGLETON PATTERN IV public class ThreadSafeSingleton { private static ThreadSafeSingleton instance = null; protected ThreadSafeSingleton() { // Exists only to defeat instantiation. public synchronized static ThreadSafeSingleton getinstance() { if(instance == null) { instance = new ThreadSafeSingleton(); return instance; -java/simply-singleton.html
16 ABSTRACT FACTORY (KIT) I Provide an interface for creating families of related or dependent object without specifying their concrete classes Used to de-couple clients from a particular concrete implementation Example: Different implementations of handling an order s costs (e.g. TaxCalculator(EU,USA, CN,etc), shipping costs, etc)
17 ABSTRACT FACTORY (KIT) IIA
18 ABSTRACT FACTORY (KIT) IIB
19 ABSTRACT FACTORY (KIT) III Use the Abstract Factory pattern when a system should be independent of how its products are created, composed, and represented. a system should be configured with one of multiple families of products. a family of related product objects is designed to be used together, and you need to enforce this constraint. you want to provide a class library of products, and you want to reveal just their interfaces, not their implementations.
20 ABSTRACT FACTORY (KIT) IV Benefits: Isolates concrete classes Allows to change product family easily Promotes consistency among products Factory usually a Singleton; ideally create<object> should have a type parameter to make it extensible
21 ABSTRACT FACTORY (KIT) V Step 1: The Interface public interface Shape { void draw(); Step 2: The Concrete Class public class Rectangle implements Shape public void draw() { System.out.println("Inside Rectangle::draw() method.");
22 ABSTRACT FACTORY (KIT) V Step 3: Create the Abstract Factory Class public abstract class AbstractFactory { abstract Shape getshape(string shape) ; Step 4: Create the Concrete Factory Class public class ShapeFactory extends AbstractFactory public Shape getshape(string shapetype){ if(shapetype == null){ return null; if(shapetype.equalsignorecase("rectangle")){ return new Rectangle(); return null;
23 ABSTRACT FACTORY (KIT) V Step 5: Create Factory Producer public class FactoryProducer { public static AbstractFactory getfactory(string choice){ if(choice.equalsignorecase("shape")){ return new ShapeFactory(); return null;
24 ABSTRACT FACTORY (KIT) V Step 6: Use Producer to Get Factories public class AbstractFactoryPatternDemo { public static void main(string[] args) { //get shape factory AbstractFactory shapefactory = FactoryProducer.getFactory("SHAPE"); // get an object of Shape Rectangle Shape shape1 = shapefactory.getshape( RECTANGLE"); // call draw method of Shape Rectangle shape1.draw();
25 STRUCTURAL PATTERNS In this section, we ll discuss the following patterns Adapter (or Wrapper) Pattern Bridge Pattern Composite Pattern Decorator Pattern Façade Pattern
26 ADAPTER (WRAPPER) I Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces. Example Merging a new library with an old library you discover two methods with the same name but different parameters
27 ADAPTER (WRAPPER) II Benefits: Allow two or more incompatible objects to communicate and interact. Improves reusability of older functionality.
28 ADAPTER (WRAPPER) III Use when: When you want to use an existing class, and its interface does not match the interface you need. When you want to create a reusable class that cooperates with unrelated or unforeseen classes, classes that don't necessarily have compatible interfaces.
29 ADAPTER (WRAPPER) III When you want to use an object in an environment that expects an interface that is different from the object's interface. When you must ensure interface translation among multiple sources.
30 ADAPTER (WRAPPER) III
31 ADAPTER (WRAPPER) III Step 1: Create the interfaces public interface MediaPlayer { public void play(string audiotype, String filename); public interface AdvancedMediaPlayer { public void playvlc(string filename); public void playmp4(string filename);
32 ADAPTER (WRAPPER) III Step 2: Create the concrete class implementing the advanced interface public class VlcPlayer implements public void playvlc(string filename) { System.out.println("Playing vlc file. Name: "+ public void playmp4(string filename) { //do nothing
33 ADAPTER (WRAPPER) III Step 2: Create the concrete class implementing the advanced interface public class VlcPlayer implements public void playvlc(string filename) { System.out.println("Playing vlc file. Name: "+ public void playmp4(string filename) { //do nothing
34 ADAPTER (WRAPPER) III Step 3: Create the adapter for MediaPlayer public class MediaAdapter implements MediaPlayer { AdvancedMediaPlayer advancedmusicplayer; public MediaAdapter(String audiotype){ if(audiotype.equalsignorecase("vlc") ){ advancedmusicplayer = new VlcPlayer(); else if (audiotype.equalsignorecase("mp4")){ advancedmusicplayer = new public void play(string audiotype, String filename) { if(audiotype.equalsignorecase("vlc")){ advancedmusicplayer.playvlc(filename); else if(audiotype.equalsignorecase("mp4")){ advancedmusicplayer.playmp4(filename);
35 ADAPTER (WRAPPER) III Step 4: Create the concrete implementation of the adapter public class AudioPlayer implements MediaPlayer { MediaAdapter public void play(string audiotype, String filename) { //inbuilt support to play mp3 music files if(audiotype.equalsignorecase("mp3")){ System.out.println("Playing mp3 file. Name: " + filename); //mediaadapter is providing support to play other file formats else if(audiotype.equalsignorecase("vlc") audiotype.equalsignorecase("mp4")){ mediaadapter = new MediaAdapter(audioType); mediaadapter.play(audiotype, filename); else{ System.out.println("Invalid media. " + audiotype + " format not supported");
36 ADAPTER (WRAPPER) III Step 5: Use the adapter public class AdapterPatternDemo { public static void main(string[] args) { AudioPlayer audioplayer = new AudioPlayer(); audioplayer.play("mp3", "beyond the horizon.mp3"); audioplayer.play("mp4", "alone.mp4"); audioplayer.play("vlc", "far far away.vlc"); audioplayer.play("avi", "mind me.avi");
37 BRIDGE (HANDLE) PATTERN I Used to decouple an abstraction from its implementation so that the two can vary independently When an abstraction (abstract class) can have several implementations, the usual way to accommodate them is to use inheritance This isn t always a flexible approach because the implementation binds to the abstraction permanently
38 BRIDGE (HANDLE) PATTERN I Use the pattern when: You want to avoid a permanent binding between an abstraction and its implementation Both the abstractions and the implementations should be extensible by sub-classing Changes in the implementation of an abstraction should not impact clients
39 BRIDGE (HANDLE) PATTERN II Use the pattern when (cont): You have a class hierarchy that proliferates because it needs to adapt to various specific implementations You want to share an implementation among multiple objects but you want to keep the fact hidden from the client.
40 BRIDGE (HANDLE) PATTERN III Known uses GUI frameworks as discussed previously. Persistence Frameworks Consequences: Implementation is not bound permanently to an interface Eliminates compile time dependencies (no recompilation of abstract class) Decoupling encourages layering, therefore a better structured system Improved extensibility Hiding implementation details from clients
41 COMPOSITE PATTERN I Used to compose objects into tree structures to represent part-whole hierarchies. Clients treat individual objects and compositions of objects uniformly Example Consider graphics applications that allow users to build complex diagrams out of simple components which can be grouped into more complex ones A simple implementation would define classes for graphical primitives and other classes that act as containers for these primitives Problem: code using these classes must treat primitives and objects differently The distinction increases the complexity of the system The pattern uses recursive composition so clients do not make this distinction
42 COMPOSITE PATTERN II Use the pattern when: You want to represent part-whole hierarchies of objects You want clients to be able to ignore differences between compositions of objects and individual objects
43 COMPOSITE PATTERN III Example Consequences Define class hierarchies consisting of primitive objects and composite objects Simplifies the client s architecture Simplifies the process of adding new components The design can be overly general (disadvantage)
44 DECORATOR (WRAPPER) PATTERN I Decorator is used to attach responsibilities to an object dynamically Decorators provide a flexible alternative to sub-classing for extending functionality Why use it? We use it when we need to add responsibilities to individual objects, not the entire class (e.g. adding borders or scrollbars to a visual widget) If you use inheritance will affect every instance which will not allow it to vary the choice as it is statically linked The solution is to add the object, called the decorator or wrapper, within another that adds the required property
45 DECORATOR (WRAPPER) PATTERN II Use the Decorator To add responsibilities to individual objects dynamically and transparently To withdraw responsibilities from the object When extending by sub-classing is impractical or not permitted A large number of independent extensions would result in an explosion of classes A class definition may be hidden or sealed (final)
46 DECORATOR (WRAPPER) PATTERN III Consequences More flexible than static inheritance Easier to add a property twice (e.g. a widget with a double border) Avoids feature-laden classes up in the hierarchy, reducing complexity. Features are added incrementally with new decorator objects The decorator and its component are identical, the decorator is a transparent enclosure similar to a photograph frame Lots of little objects (disadvantage), difficult to learn and debug Used frequently in UI Toolkits and in the implementation of IO stream classes
47 FAÇADE PATTERN I Provides a unified interface to a set of interfaces in a subsystem Defines a higher level interface that makes the subsystem easier to use Structuring a system into subsystems helps reduce complexity Common design goal is to minimise communication and dependency between subsystems Façade objects provides a single, simplified interface to more general facilities of the sub-system
48 FAÇADE PATTERN II Example: Programming environment providing access to its compiler subsystem Higher level interface shields clients from intricate details of different parts of compiler by allowing access to specific functionality of different subparts Use Façade when: Provide a simple interface to a complex system There are many dependencies between clients and the implementation classes of an abstraction Façade decouples the sub-system from clients Layer your subsystems. Façade defines the entry to each subsystem layer
49 FAÇADE PATTERN III Consequences Shields clients from sub-system components Promotes weak coupling between sub-system and its clients Reduces compilation dependencies Does not prevent applications from using subsystem classes if they need to
50 BEHAVIOURAL PATTERNS These are some common behavioural patterns: Iterator Pattern Observer Pattern Strategy Pattern
51 ITERATOR (CURSOR) PATTERN I Provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation An aggregate object (e.g. List) should give you a way to access its elements without exposing its structure You might want to traverse the list in many ways, but you want to keep the design and implementation of the List clean The idea of the pattern is to take the responsibility for accessing and traversing the list using at iterator object The iterator keeps track of the current element The List is responsible for creating its own iterator, possibly using a Factory to generalise the operation
52 ITERATOR (CURSOR) PATTERN II Use this pattern when you want To access an aggregate object s contents without exposing its internal representation Support multiple traversals of aggregate objects Provide a uniform interface for traversing different aggregate structures
53 ITERATOR (CURSOR) PATTERN III Consequences of using this pattern Supports variations in the traversal of an aggregate Simplify the aggregate interface Mode than one traversal can be pending on the same aggregate Known uses: Collection classes (Lists, Vectors, etc)
54 OBSERVER (DEPENDENTS) PATTERN I Defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically When partitioning a system into a collection of cooperating classes, one needs to maintain consistency between related objects Note that tightly coupling class is not a solution because it reduces reusability The observer pattern describes how to establish common relationships between objects The key objects are the subject and the observer All observer are notified when the subject changes (publish-subscribe model)
55 OBSERVER (DEPENDENTS) PATTERN II Used when Abstraction has two aspects, one dependent on the other. Encapsulate the objects separately and reuse them independently When a change to one object requires changing the others, and you do not know how many objects to change When an object needs to be able to notify other objects without making assumptions about who these objects are (not tightly coupled)
56 OBSERVER (DEPENDENTS) PATTERN III Consequences Abstract coupling between Subject and Observer. Subject knows that it has a list of observers conforming to the observer interface, it does not know the concrete class of the observer minimal coupling Support for broadcast communication Unexpected updated (disadvantage). Since observers have no knowledge of other observers, changing the subject might result in undesired updates
57 STRATEGY (POLICY) PATTERN I Define a family of algorithms that encapsulate one another and make them interchangeable Strategy lets the algorithm vary independently of the client that uses them Example: Many algorithms exist for breaking a stream of text into lines. Hard-wiring all algorithms into the classes that require them is not desirable because Client get overly complex Different algorithms will be appropriate at different times Difficult to add new algorithms and vary existing ones
58 STRATEGY (POLICY) PATTERN II Use this pattern when Many related classes differ only in their behaviour Need different variants of an algorithm An algorithm uses data that clients shouldn t know about (avoid exposing complex, algorithm-specific data structures) A class defines many behaviours that appear as multiple conditional statements in its operators
59 STRATEGY (POLICY) PATTERN III Consequences Families of related algorithms. Hierarchies of Strategy classes define a family of algorithms that can be reused An alternative to sub-classing, which is easier to switch to, understand and extend Strategies eliminate conditional statements Provides a choice of implementations Clients must be aware of different strategies (disadvantage) Communication overhead between Strategy and Context (Strategy interface is shared, so some simple concrete classes may use little or none of the parameters passes to them. Tightly couple context and strategy to solve this problem) Increased number of objects
60 OTHER Model-View-Controller (MVC) This pattern isolates domain logic from the user interface The model manages the behaviour and data of the application domain, The view renders the model into a form suitable for interaction, typically a user interface element. The controller receives input and initiates a response by making calls on model objects. A controller accepts input from the user and instructs the model and viewport to perform actions based on that input. Sometimes considered a framework
61 FURTHER READING Gamma, E., Helm, R., Johnson, R., & Vlissides, J. (2007). Design Patterns: Elements of Reusable Object-Oriented Software. USA: Addison-Wesley Professional (ISBN ) McConell, S. (2004). Code Complete: A Practical Handbook of Software Construction. USA: MICROSOFT PRESS (ISBN ) Alur, D., Malks, D., & Crupi, J. (2003). Core J2EE Patterns: Best Practices and Design Strategies. USA: Prentice Hall (ISBN )
Design Pattern Examples
Factory Pattern (Creational) Design Pattern Examples Goal: Define an interface for creating an object, but let the classes that implement the interface decide which class to instantiate. The Factory method
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 informationCS 370 Design Heuristics D R. M I C H A E L J. R E A L E F A L L
CS 370 Design Heuristics D R. M I C H A E L J. R E A L E F A L L 2 0 1 5 Introduction Now we ll talk about ways of thinking about design Guidelines for trials in trial and errors Major Design Heuristics
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 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 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 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 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 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 informationLecture 13: Design Patterns
1 Lecture 13: Design Patterns Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2005 2 Pattern Resources Pattern Languages of Programming Technical conference on Patterns
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 informationPattern Resources. Lecture 25: Design Patterns. What are Patterns? Design Patterns. Pattern Languages of Programming. The Portland Pattern Repository
Pattern Resources Lecture 25: Design Patterns Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2003 Pattern Languages of Programming Technical conference on Patterns
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 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 V Structural Design Patterns, 2
Structural Design Patterns, 2 COMP2110/2510 Software Design Software Design for SE September 17, 2008 Department of Computer Science The Australian National University 19.1 1 2 Formal 3 Formal 4 Formal
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 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 informationThink of drawing/diagramming editors. ECE450 Software Engineering II. The problem. The Composite pattern
Think of drawing/diagramming editors ECE450 Software Engineering II Drawing/diagramming editors let users build complex diagrams out of simple components The user can group components to form larger components......which
More informationDesign Patterns. CSC207 Fall 2017
Design Patterns CSC207 Fall 2017 Design Patterns A design pattern is a general description of the solution to a well-established problem using an arrangement of classes and objects. Patterns describe the
More informationDesign Patterns. Comp2110 Software Design. Department of Computer Science Australian National University. Second Semester
Design Patterns Comp2110 Software Design Department of Computer Science Australian National University Second Semester 2005 1 Design Pattern Space Creational patterns Deal with initializing and configuring
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 informationDesign Patterns. CSC207 Fall 2017
Design Patterns CSC207 Fall 2017 Design Patterns A design pattern is a general description of the solution to a well-established problem using an arrangement of classes and objects. Patterns describe the
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. 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 informationDesign Patterns. CSC207 Winter 2017
Design Patterns CSC207 Winter 2017 Design Patterns A design pattern is a general description of the solution to a well-established problem using an arrangement of classes and objects. Patterns describe
More informationhttps://www.lri.fr/~linaye/gl.html
Software Engineering https://www.lri.fr/~linaye/gl.html lina.ye@centralesupelec.fr Sequence 3, 2017-2018 1/50 Software Engineering Plan 1 2 3 4 5 2/50 Software Engineering ground Evolution of Program 3/50
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 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 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 informationDesign Patterns IV Structural Design Patterns, 1
Structural Design Patterns, 1 COMP2110/2510 Software Design Software Design for SE September 17, 2008 Class Object Department of Computer Science The Australian National University 18.1 1 2 Class Object
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 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 informationDesign Patterns IV. Alexei Khorev. 1 Structural Patterns. Structural Patterns. 2 Adapter Design Patterns IV. Alexei Khorev. Structural Patterns
Structural Design Patterns, 1 1 COMP2110/2510 Software Design Software Design for SE September 17, 2008 2 3 Department of Computer Science The Australian National University 4 18.1 18.2 GoF Structural
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 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 informationADAPTER. Topics. Presented By: Mallampati Bhava Chaitanya
ADAPTER Presented By: Mallampati Bhava Chaitanya Topics Intent Motivation Applicability Structure Participants & Collaborations Consequences Sample Code Known Uses Related Patterns Intent Convert the interface
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 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 informationINTERNAL ASSESSMENT TEST III Answer Schema
INTERNAL ASSESSMENT TEST III Answer Schema Subject& Code: Object-Oriented Modeling and Design (15CS551) Sem: V ISE (A & B) Q. No. Questions Marks 1. a. Ans Explain the steps or iterations involved in object
More informationSoftware Engineering - I An Introduction to Software Construction Techniques for Industrial Strength Software
Software Engineering - I An Introduction to Software Construction Techniques for Industrial Strength Software Chapter 9 Introduction to Design Patterns Copy Rights Virtual University of Pakistan 1 Design
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 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 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 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 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 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 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 informationDesign Patterns #3. Reid Holmes. Material and some slide content from: - GoF Design Patterns Book - Head First Design Patterns
Material and some slide content from: - GoF Design Patterns Book - Head First Design Patterns Design Patterns #3 Reid Holmes Lecture 16 - Thursday November 15 2011. GoF design patterns $ %!!!! $ "! # &
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 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 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 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 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 Pattern: Composite
Design Pattern: Composite Intent Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly. Motivation
More informationWhat is a Pattern? Lecture 40: Design Patterns. Elements of Design Patterns. What are design patterns?
What is a Pattern? Lecture 40: Design Patterns CS 62 Fall 2017 Kim Bruce & Alexandra Papoutsaki "Each pattern describes a problem which occurs over and over again in our environment, and then describes
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 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 informationAn Expert System for Design Patterns Recognition
IJCSNS International Journal of Computer Science and Network Security, VOL.17 No.1, January 2017 93 An Expert System for Design Patterns Recognition Omar AlSheikSalem 1 and Hazem Qattous 2 1 Department
More informationDesign Patterns. Definition of a Design Pattern
Design Patterns Barbara Russo Definition of a Design Pattern A Pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem,
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 informationCOURSE 4 DESIGN PATTERNS
COURSE 4 DESIGN PATTERNS PREVIOUS COURSE Creational Patterns Factory Method defines an interface for creating objects, but lets subclasses decide which classes to instantiate Abstract Factory provides
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 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 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 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 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 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 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 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 informationDESIGN PATTERNS Course 4
DESIGN PATTERNS Course 4 COURSE 3 - CONTENT Creational patterns Singleton patterns Builder pattern Prototype pattern Factory method pattern Abstract factory pattern CONTENT Structural patterns Adapter
More informationCocoa Design Patterns. Erik M. Buck October 17, 2009
Cocoa Design Patterns Erik M. Buck October 17, 2009 Topics n What is a design pattern? n Why Focus on design patterns? n What is the Model View Controller design pattern? n Using MVC n When wouldn t you
More informationCS342: Software Design. November 21, 2017
CS342: Software Design November 21, 2017 Runnable interface: create threading object Thread is a flow of control within a program Thread vs. process All execution in Java is associated with a Thread object.
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 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 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 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 informationMore on Design. CSCI 5828: Foundations of Software Engineering Lecture 23 Kenneth M. Anderson
More on Design CSCI 5828: Foundations of Software Engineering Lecture 23 Kenneth M. Anderson Outline Additional Design-Related Topics Design Patterns Singleton Strategy Model View Controller Design by
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 informationWork groups meeting 3
Work groups meeting 3 INF5040 (Open Distributed Systems) Sabita Maharjan sabita@simula.no Department of Informatics University of Oslo September 07, 2009 Design Patterns J2EE Design Patterns Outline EIS
More informationSummary of the course lectures
Summary of the course lectures 1 Components and Interfaces Components: Compile-time: Packages, Classes, Methods, Run-time: Objects, Invocations, Interfaces: What the client needs to know: Syntactic and
More informationReuse at Design Level: Design Patterns
Reuse at Design Level: Design Patterns CS 617- Lecture 17 Mon. 17 March 2008 3:30-5:00 pm Rushikesh K. Joshi Department of Computer Sc. & Engg. Indian Institute of Technology, Bombay Mumbai - 400 076 Reuse
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 informationTecniche di Progettazione: Design Patterns
Tecniche di Progettazione: Design Patterns GoF: Decorator 1 2 3 4 Decorator Intent Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing
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 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 informationDesign Patterns Revisited
CSC 7322 : Object Oriented Development J Paul Gibson, A207 paul.gibson@int-edu.eu http://www-public.it-sudparis.eu/~gibson/teaching/csc7322/ Design Patterns Revisited /~gibson/teaching/csc7322/l13-designpatterns-2.pdf
More informationDesign Patterns. Claus Jensen
Design Patterns Claus Jensen What is a Design Pattern? A design pattern Abstracts a recurring design structure Distils design experience Promotes reuse of design and code Gives an opportunity to see how
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 informationPatterns. Giovanni Sakti. in Software Engineering. Starqle
Patterns in Software Engineering Giovanni Sakti Starqle What is Patterns? Patterns Patterns describes a problem, which occurs over and over again in our environment and then desribes the core of the solution
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 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 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 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 informationDesign Pattern - Factory Pattern
Design Pattern - Factory Pattern Factory pattern is one of most used design pattern in Java. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to
More informationObject-Oriented Design
Object-Oriented Design Lecture 14: Design Workflow Department of Computer Engineering Sharif University of Technology 1 UP iterations and workflow Workflows Requirements Analysis Phases Inception Elaboration
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 informationCPSC 310 Software Engineering. Lecture 11. Design Patterns
CPSC 310 Software Engineering Lecture 11 Design Patterns Learning Goals Understand what are design patterns, their benefits and their drawbacks For at least the following design patterns: Singleton, Observer,
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 information