TDDB84. Summary & wrap-up & some tips & some design patterns & some other stuff. tisdag 20 oktober 15

Size: px
Start display at page:

Download "TDDB84. Summary & wrap-up & some tips & some design patterns & some other stuff. tisdag 20 oktober 15"

Transcription

1 TDDB84 Summary & wrap-up & some tips & some design patterns & some other stuff

2 Agenda Course goals, expectations Writing papers: FAQ Design Patterns revisited Course summary Life after the course

3 Course goals Identify and explain software design principles and design patterns in existing object-oriented software. Lab 1, 2

4 Course goals Apply software design principles and design patterns when working with existing object-oriented software. Lab 1, 3

5 Course goals Describe the purpose and consequences of design patterns in object-oriented software. Lab 2, 3, final paper

6 Course goals Critically evaluate software design principles and design patterns in relationship to software qualities. Lab 3, final paper

7 Course goals Analyze the relationship between software design principles, design patterns, programming languages and application frameworks. Final paper

8 Expectations Learn about design patterns Learn when to use design patterns Learn about design patterns in real software Learn about the consequences of design patterns

9 Writing Papers, FAQ

10 Writing Papers, tips Be specific precise formal direct unapologetic What is complexity? Design complexity, cyclomatic complexity? This is not a popular science text. Refrain from wording that is ambiguous or less well defined ( forgiving, good, bad, easy ) Do not say something is very hard, use a reference and be precise about what exactly that reference says Do not say you will do something, or intends, be direct and state what you DO, or have DONE. You do not have to state someone made me write this, or Due to time constraints : you will ALWAYS have external constraints on your work, as does everyone else. Write about what you have done, do not make excuses for what you have not done.

11 Writing Papers, tips Use references the style of research papers as a guide the hourglass style your team Back up all claims with references Check your wording & justifications against academic publications, not previous years reports. Everything before the narrow part should lead to the waist, and everything after should relate to the waist. Don t let your paper be overly focused on background material: you need to introduce only that which is necessary for someone else of approximately your own backgrounds (before the course) to understand the core of your paper: your evaluation of a specific design pattern. Please do conduct a second round of reviews

12 Design Patterns revisited

13 Principles + Problem = Pattern

14 Principles = SOLID + Some more tips

15 Some more tips Encapsulate what varies Program to an interface not to an implementation Favor Composition over Inheritance Don t call us, we ll call you

16 Some more tips Depend upon abstractions. Do not depend upon concrete classes. Strive for loosely coupled designs between objects that interact Only talk to your friends

17 Some Design Patterns

18 You choose! Strategy Factory Method Decorator Template Method Composite Abstract Factory (+ Dependency Injection) Singleton (+ example in Ruby) Builder Adapter Bridge Observer Chain of Responsibility Memento Command

19 Strategy

20 Strategy Strategy Context Client

21 Strategy: Consequences + Can choose implementation of a strategy at run time + Eliminate hardcoded conditionals - Clients must be aware of different strategies - Communication required between context and strategies + Avoids excessive subclassing - Potentially many strategy objects created

22 Factory Method

23 Factory method (before)

24 Factory method (before) Pizza pizza = null; if (style.equals("ny")) { if (type.equals("cheese")) { pizza = new NYStyleCheesePizza(); } else if (type.equals("veggie")) { pizza = new NYStyleVeggiePizza(); } else if (type.equals("clam")) { pizza = new NYStyleClamPizza(); } else if (type.equals("pepperoni")) { pizza = new NYStylePepperoniPizza(); } } else if (style.equals("chicago")) { if (type.equals("cheese")) { pizza = new ChicagoStyleCheesePizza(); } else if (type.equals("veggie")) { pizza = new ChicagoStyleVeggiePizza(); } else if (type.equals("clam")) { pizza = new ChicagoStyleClamPizza(); } else if (type.equals("pepperoni")) { pizza = new ChicagoStylePepperoniPizza(); } } else { System.out.println("Error: invalid type of pizza"); return null; }

25 Factory method

26 Factory method + Decouples clients from specific dependency classes + Eliminates hardcoded conditionals + Connects parallel class hierarchies (NY*Pizza, Chicago*Pizza) - Requires keeping factory methods in sync with domain classes

27 Decorator

28 Component Decorator Beverage b = new Coffee(); b = new SweetenedBeverage(new SweetenedBeverage(b)); Decorator return 5+beverage.cost();

29 Decorator + Dynamically adds behavior to specific instances of a class + Customizes an abstract class without knowing the implementations - - Decorator objects are not of the same type as the objects it comprises May result in many small objects

30 Template Method

31 class Beverage { public: void preparerecipe(); void boilwater(); void pourincup(); }; class Coffee{ public: void preparerecipe(); void boilwater(); void brewcoffeegrinds(); void pourincup(); void addsugarandmilk(); }; class Tea{ public: void preparerecipe(); brew void boilwater(); void steepteabag(); addcondiments void pourincup(); void addlemon(); };

32 Template method: Consequences + Can isolate the extensions possible to an algorithm + Isolates clients from algorithm changes

33 Template method

34 Default implementations (hooks) public abstract class CaffeineBeverageWithHook { void preparerecipe() { boilwater(); brew(); pourincup(); if (customerwantscondiments()) { addcondiments(); } } boolean customerwantscondiments() { return true; } public class CoffeeWithHook extends CaffeineBeverageWithHook { [... ] public boolean customerwantscondiments() { return getuserinput().tolowercase().startswith("y"); } }

35 Duck[] ducks = { new Duck("Daffy", 8), new Duck("Dewey", 2), new Duck("Howard", 7), new Duck("Louie", 2), new Duck("Donald", 10), new Duck("Huey", 2) }; Template method? Arrays.sort(ducks, new public int compare(duck arg0, Duck arg1) { return new Integer(arg1.weight).compareTo(arg0.weight); } No }); public class Duck implements Comparable<Duck> { String name; int weight; public Duck(String name, int weight) { this.name = name; this.weight = weight; } public String tostring() { return MessageFormat.format("{0} weighs {1}", name, weight); } } public int compareto(duck object) { return new Integer(this.weight).compareTo(object.weight); } Yes

36 // Java 8: With inline lambda Arrays.sort(ducks, (arg0, arg1) -> new Integer(arg1.weight).compareTo(arg0.weight));

37 Composite

38 Waiter Diner menu print() printmenu() Pizza menu Breakfast menu print() Clam Pizza Cheese Pizza Coffee menu Ham & eggs Spam & eggs Eggs & spam Spam, spam & eggs print() Dark roast Coffee Tea Espresso print()

39

40 Client Component Composite Leaf

41 Composite: consequences - + Allow us to treat composite objects and individual objects uniformly Creates composite classes that violate the principle of a single responsibility + Allows arbitrarily complex trees - The composite cannot rely on components to implement all methods

42 Abstract factory

43 Ingredients Pizza Store Clients Fresh Clam Mozzarella Cheese NY Thin Crust Dough I Want a Cheese Pizza Frozen Clam Parmesan Cheese Chicago Thick Crust Dough

44

45

46

47

48

49 Concrete Factory Abstract Factory Abstract Products

50 Clients

51 Abstract factory: consequences + Isolates clients from concrete dependencies + Makes interchanging families of products easier

52 Strategy When related classes only differ in behavior You need different variants of an algorithm An algorithm uses data the clients don t need to know A class uses conditionals for selecting behavior Behavioral Abstract Factory A system should be independent of how its products are created A system should be configured with one of multiple families of products You want to provide a class library of products, and only expose their interfaces Creational

53 Design principles Encapsulate what varies Program to an interface, not to an implementation Favor composition over inheritance Classes should be open for extension but closed for modification Don t call us, we ll call you

54 Dependency Injection

55 ICheesePizza -cheese <<ICheese> > StandardCheesePizza MozzarellaCheese ParmesanCheese IClamPizza -cheese -clam <<IClam>> FancyClamPizza FreshClam FrozenClam NYStyle ChicagoStyle Distinguished by namespaces in C#

56 DI: How? 1. Declare dependencies as constructor arguments of interface types 2. Register classes (components) in an Inversion-of-Control Container 3. Resolve the top-level object from an interface through the Container

57 1. Dependencies namespace DITest {! public class FancyClamPizza: IClamPizza! {!! private IClam clam;!! private ICheese cheese;!! public FancyClamPizza (IClam clam, ICheese cheese)!! {!!! this.clam = clam;!!! this.cheese = cheese;!! }!! public String ClamType() {!!! return String.Format("fancy {0}",clam);!! }!! public String Describe() {!!! return String.Format("fancy clam pizza with {0} and {1}",ClamType(), cheese);!! }! } }

58 2. Registration namespace DITest {! public class IoCInstaller: IWindsorInstaller! {!! public void Install(IWindsorContainer container, IConfigurationStore store)!! {!!! container.register(classes!!!.fromthisassembly()!!!.innamespace("ditest.nystyle")!!!.withserviceallinterfaces());!!! container.register (Classes!!!.FromThisAssembly()!!!.AllowMultipleMatches()!!!.InSameNamespaceAs<IoCInstaller>()!!!.WithServiceAllInterfaces());!! }! } } Castle Windsor,

59 3. Resolution!!! var container = new WindsorContainer();!!! // adds and configures all components using WindsorInstallers from executing assembly!!! container.install(fromassembly.this());!!! // instantiate and configure root component and all its dependencies and their dependencies and...!!! var p = container.resolve<icheesepizza>();!!! Console.WriteLine (p.describe ());

60 Singleton

61 public class Singleton { private static Singleton instance = new Singleton(); private String name; public String getname() { return name; } public static void someothermethod(){ System.out.println("Hi there!"); } What about static methods? private Singleton() { [... ] } } private Singleton() { try { // Very expensive job indeed Thread.sleep(100); } catch (InterruptedException e) { e.printstacktrace(); } name = Math.random() > 0.5? "Jonas" : "Anders"; } Our app takes forever to load

62 Thread t1 = new Thread(new StaticMethodInvocation()); Thread t2 = new Thread(new SingletonLookup()); t0 = System.nanoTime(); t1.start(); t2.start(); try { t1.join(); t2.join(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printstacktrace(); } someothermethod invoked Singleton name: Anders Singleton lookup took ns Static method invocation took ns

63 How about now? private static Singleton instance; public static Singleton getinstance() { if (instance == null) { instance = new Singleton(); } return instance; } someothermethod invoked Static method invocation took ns Singleton name: Anders Singleton lookup took ns

64 What about threads?

65 private Singleton() { try { // Very expensive job indeed Thread.sleep(100); } catch (InterruptedException e) { e.printstacktrace(); } name = Math.random() > 0.5? "Jonas" : "Anders"; } private static final class SingletonLookup implements Runnable public void run() { System.out.println(MessageFormat.format("Singleton name: {0}", Singleton.getInstance().getName())); } } public static void main(string[] args) { Thread t1 = new Thread(new SingletonLookup()); Oops! Thread t2 = new Thread(new SingletonLookup()); t0 = System.nanoTime(); t1.start(); t2.start(); try { t1.join(); Singleton name: Anders t2.join(); Singleton name: Jonas } catch (InterruptedException e) { Singleton name after our threads have run: Anders // TODO Auto-generated catch block e.printstacktrace(); } System.out.println("Singleton name after our threads have run: "+Singleton.getInstance().getName()); }

66 public static synchronized Singleton getinstance() { if (instance == null) { instance = new Singleton(); } return instance; } Singleton name: Anders Singleton name: Anders Singleton lookup took ns Singleton lookup took ns Singleton name after our threads have run: Anders Woohoo!

67 Singleton as Enum public enum EnumSingleton { } INSTANCE; private String name; private int age; public String getname() { return name; } public void setname(string name) { this.name = name; } public int getage() { return age; } public void setage(int age) { this.age = age; }

68 Singletons in Ruby Object MetaClass A class A; end Class Singleton Class for foo class << foo; end Singleton Class for A class << A; end foo foo = A.new A class A; end

69 class A end a = A.new class << A def new raise "Illegal!" end end irb(main):014:0> a #<A:0x007f8d6b92bcb0> irb(main):016:0> A.new RuntimeError: Illegal! from (irb):10:in `new' from (irb):16 from /Users/olale/.rvm/rubies/ruby p247/bin/irb:13:in `<main>' Now we have one object, but we cannot produce another of the same class

70 Singleton: consequences - + Ensures single objects per class Violates several design principles!

71 Singleton considered dangerous Encapsulate what varies Program to an interface, not to an implementation Favor composition over inheritance Classes should be open for extension but closed for modification Don t call us, we ll call you Depend on abstractions, do not depend on concrete classes Classes should only have one reason to change Strive for loosely-coupled design

72 Builder

73

74 Client Director Builder build() builda() buildb() buildc() getproduct()

75

76 Client Director Builder

77 Abstract Factory Client receives a Factory Client requests a product from Factory Client receives an abstract product Builder Client initializes Director with Builder Client asks Director to build Client requests product from Builder Client receives a builder-specific product

78 Builder: consequences + Can control the way objects are created + Can produce different products using the same Director - - Not necessarily a common interface for products Clients must know how to initialize builders and retrieve products

79 Adapter

80 Class Adapter Object Adapter

81 Multiple back-end objects Client Target do() Adapter -adaptee1 -adaptee2 do() Adaptee1 +perform() Adaptee2 +perform()

82 Multiple back-end methods Client Target do() Adapter -adaptee do() Adaptee1 +foo() +bar() adaptee.foo() adaptee.bar()

83 public interface Duck { public void quack(); public void fly(); } public interface Turkey { public void gobble(); public void fly(); } public class TurkeyAdapter implements Duck { Turkey turkey; } public TurkeyAdapter(Turkey turkey) { this.turkey = turkey; } public void quack() { turkey.gobble(); } public void fly() { for(int i=0; i < 5; i++) { turkey.fly(); } } public class DuckAdapter implements Turkey { Duck duck; Random rand; } public DuckAdapter(Duck duck) { this.duck = duck; rand = new Random(); } public void gobble() { duck.quack(); } public void fly() { if (rand.nextint(5) == 0) { duck.fly(); } }

84 Adapter: consequences + Isolates interface changes to the adapter class - Class adapters require target interfaces or multiple inheritance in the language

85 Bridge

86 Abstraction == That which we (should) care about

87 TV Samsung LG Logitech Harmony On() Off() On() Off() Remote One For All On() Off() On() Off()

88 Message type Password recovery Signup Send() Send() Transmission type SMS Send() Send()

89 Bridge Strategy Intent Collaborations Decouple two class hierarchies (abstraction/ implementation) The Bridge forwards requests to the Implementor Allow for exchangeable algorithms The Context and Strategy collaborate, passing data between them

90 Bridge Adapter Intent Decouple two class hierarchies (abstraction/ implementation) Convert an existing class to fit a new interface Applicability In a new system In an existing system

91 Design principles Encapsulate what varies Program to an interface, not to an implementation Favor composition over inheritance Classes should be open for extension but closed for modification Don t call us, we ll call you Depend on abstractions, do not depend on concrete classes Classes should only have one reason to change

92 Bridge: consequences + Lets two class hierarchies with common superclasses vary independently - If some implementation classes do not support an abstract concept, the abstraction breaks

93 Observer

94

95 Weather Station Humidity Display Average Temp Display subscribe() subscribe() publish() publish() unsubscribe() publish()

96

97 Subject Concrete Observer

98 Mediator vs Observer

99 Design principles Encapsulate what varies Program to an interface, not to an implementation Favor composition over inheritance Classes should be open for extension but closed for modification Don t call us, we ll call you Depend on abstractions, do not depend on concrete classes Classes should only have one reason to change Strive for loosely-coupled design

100 Chain of Responsibility

101 SPAM Filter isspam(message) accept Size Filter istoolarge(message) accept Sorting Filter sort(message) process reject reject Message arrived Message rejected

102

103 Examples Logging Input management in GUI:s

104 CoR: consequences + provides the Observer with more control over invocation of targets - A handler does not know if it will receive a message, depending on the behavior of other handlers in the chain

105 Memento

106

107 Iterative Optimizer iteration current target value current solution Optimize() Abort() GetState() SetState() SolverMemento iteration current target value current solution Client - memento - optimizer Optimize() Abort() ResetOptimizer(SolverMemento)

108

109 Mementos in GUI:s - Undo/Redo User Name Age gi Ginnie gi jo User Name Ginnie Johnny Age Undo Redo Cut Copy Paste Paste special... 4 gi User Name Ginnie Age 24 Delete Select All

110 Memento: consequences - + Can externalize object state for later restoration within the lifetime of the object + Encapsulates access to the objects inner state Depending on implementation, access to private fields requires memento classes as inner/friend classes to each domain class

111 Command

112 Command Client Waiter Order Chef Order Place Order Cook

113 Remote control Joe s Ultimate Remote Control Fan High() Low() Off() GetSpeed() On Off On Off On Off On Off On Off On Off On Off Undo On() Off() Dim() Lamp TV TurnOn() TurnOff() SetChannel() TDDB84 Design Patterns

114 Client Invoker -command perform() Command +execute() Receiver +perform() Concrete Command -receiver

115 Client Invoker Concrete Commands Receiver Command

116 Command: consequences + Allows extensions of commands + Decouples the execution from the specification of the command - - Bad design if not needed! May be confusing if it removes the receiver from responsibilities

117 Course summary Practical work: Intro seminar + three labs Reflection and analysis: Reading a research paper, and studying design patterns in a real context

118 Life after the course Writing your papers :) Masters theses: 12:15! Research project in Software Engineering Exam? No.

119 Thanks for your participation, and good luck with your papers!

TDDB84: 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. 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 information

TDDB84: Lecture 5. Singleton, Builder, Proxy, Mediator. fredag 27 september 13

TDDB84: Lecture 5. Singleton, Builder, Proxy, Mediator. fredag 27 september 13 TDDB84: Lecture 5 Singleton, Builder, Proxy, Mediator Creational Abstract Factory Singleton Builder Structural Composite Proxy Bridge Adapter Template method Behavioral Iterator Mediator Chain of responsibility

More information

TDDB84. Lecture 2. fredag 6 september 13

TDDB84. Lecture 2. fredag 6 september 13 TDDB84 Lecture 2 Yes, you can bring the books to the exam Creational Factory method Structural Decorator Behavioral LE2 Creational Abstract Factory Singleton Builder Structural Composite Proxy Bridge Adapter

More information

Template Method. Kenneth M. Anderson University of Colorado, Boulder CSCI 4448/6448 Lecture 24 11/15/2007. University of Colorado, 2007

Template Method. Kenneth M. Anderson University of Colorado, Boulder CSCI 4448/6448 Lecture 24 11/15/2007. University of Colorado, 2007 Template Method Kenneth M. Anderson University of Colorado, Boulder CSCI 4448/6448 Lecture 24 11/15/2007 University of Colorado, 2007 1 Lecture Goals Cover Material from Chapter 8 of the Design Patterns

More information

Design Patterns: Composite, Memento, Template Method, Decorator, Chain of Responsibility, Interpreter

Design Patterns: Composite, Memento, Template Method, Decorator, Chain of Responsibility, Interpreter Design Patterns: Composite, Memento, Template Method, Decorator, Chain of Responsibility, Interpreter Composite Outline for Week 14 [Skrien 8.7] We need to allow users to group figures together to make

More information

The Strategy Pattern Design Principle: Design Principle: Design Principle:

The 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 information

Writing your own Java I/O Decorator p. 102 Tools for your Design Toolbox p. 105 Exercise Solutions p. 106 The Factory Pattern Baking with OO

Writing your own Java I/O Decorator p. 102 Tools for your Design Toolbox p. 105 Exercise Solutions p. 106 The Factory Pattern Baking with OO Intro to Design Patterns Welcome to Design Patterns: Someone has already solved your problems The SimUDuck app p. 2 Joe thinks about inheritance... p. 5 How about an interface? p. 6 The one constant in

More information

TDDB84 Design Patterns Lecture 06

TDDB84 Design Patterns Lecture 06 Lecture 06 Mediator, Adapter, Bridge Peter Bunus Dept of Computer and Information Science Linköping University, Sweden petbu@ida.liu.se The Mediator Peter Bunus 2 1 Peter Bunus 3 The Mediator Non Software

More information

Design Patterns Reid Holmes

Design 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 information

Design Patterns: Template Method, Strategy, State, Bridge

Design Patterns: Template Method, Strategy, State, Bridge Design Patterns: Template Method, Strategy, State, Bridge [HFDP, Ch. 8] Say we have two classes whose code looks similar, but isn t identical. We can duplicate the code, but change it where changes are

More information

Tecniche di Progettazione: Design Patterns

Tecniche di Progettazione: Design Patterns Tecniche di Progettazione: Design Patterns GoF: Template method 1 Design patterns, Laura Semini, Università di Pisa, Dipartimento di Informatica. Hint The underlying is idea not so different from Factory

More information

TDDB84: Lecture 09. SOLID, Language design, Summary. fredag 11 oktober 13

TDDB84: Lecture 09. SOLID, Language design, Summary. fredag 11 oktober 13 TDDB84: Lecture 09 SOLID, Language design, Summary SOLID Single responsibility principle Open/closed principle Liskov substitution principle Interface segregation principle Depency inversion principle

More information

Design Patterns. State. Oliver Haase

Design Patterns. State. Oliver Haase Design Patterns State Oliver Haase 1 Description Object based behavioral pattern Purpose: Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.

More information

CSE 70 Final Exam Fall 2009

CSE 70 Final Exam Fall 2009 Signature cs70f Name Student ID CSE 70 Final Exam Fall 2009 Page 1 (10 points) Page 2 (16 points) Page 3 (22 points) Page 4 (13 points) Page 5 (15 points) Page 6 (20 points) Page 7 (9 points) Page 8 (15

More information

CS342: Software Design. November 21, 2017

CS342: 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 information

SDC Design patterns GoF

SDC 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 information

Exam in TDDB84: Design Patterns,

Exam in TDDB84: Design Patterns, Exam in TDDB84: Design Patterns, 2014-10-24 14-18 Information Observe the following, or risk subtraction of points: 1) Write only the answer to one task on one sheet. Use only the front side of the sheets

More information

MORE DESIGN PATTERNS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 24 11/10/2011

MORE DESIGN PATTERNS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 24 11/10/2011 MORE DESIGN PATTERNS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 24 11/10/2011 Kenneth M. Anderson, 2011 1 Goals of the Lecture Cover the material in Chapters 18 & 19 of our textbook Observer

More information

An Introduction to Patterns

An 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 information

Design Patterns. Manuel Mastrofini. Systems Engineering and Web Services. University of Rome Tor Vergata June 2011

Design 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 information

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

CSCD01 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 information

EPL 603 TOPICS IN SOFTWARE ENGINEERING. Lab 6: Design Patterns

EPL 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 information

FACADE & ADAPTER CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 7 09/13/2011

FACADE & ADAPTER CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 7 09/13/2011 FACADE & ADAPTER CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 7 09/13/2011 1 Goals of the Lecture Introduce two design patterns Facade Adapter Compare and contrast the two patterns 2 Facade

More information

Design 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.) 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 information

Applying the Factory Method Design Pattern

Applying the Factory Method Design Pattern Applying the Factory Method 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

More information

Design Pattern and Software Architecture: IV. Design Pattern

Design Pattern and Software Architecture: IV. Design Pattern Design Pattern and Software Architecture: IV. Design Pattern AG Softwaretechnik Raum E 3.165 Tele.. 60-3321 hg@upb.de IV. Design Pattern IV.1 Introduction IV.2 Example: WYSIWYG Editor Lexi IV.3 Creational

More information

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

CSCD01 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 information

Object-Oriented Oriented Programming

Object-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 information

Factories, Builders and Singletons. Steven R. Bagley

Factories, Builders and Singletons. Steven R. Bagley Factories, Builders and Singletons Steven R. Bagley The Patterns So Far Behavioural Patterns Strategy Observer Structural Patterns Decorator Introduction Object Creational Patterns Sometimes new isn t

More information

Trusted Components. Reuse, Contracts and Patterns. Prof. Dr. Bertrand Meyer Dr. Karine Arnout

Trusted 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 information

Design Patterns (Part 2) CSCE Lecture 18-10/25/2016 (Partially adapted from Head First Design Patterns by Freeman, Bates, Sierra, and Robson)

Design Patterns (Part 2) CSCE Lecture 18-10/25/2016 (Partially adapted from Head First Design Patterns by Freeman, Bates, Sierra, and Robson) Design Patterns (Part 2) CSCE 740 - Lecture 18-10/25/2016 (Partially adapted from Head First Design Patterns by Freeman, Bates, Sierra, and Robson) Objectives for Today The point of OO: Separate what changes

More information

Laboratorio di Tecnologie dell'informazione. Ing. Marco Bertini

Laboratorio di Tecnologie dell'informazione. Ing. Marco Bertini Laboratorio di Tecnologie dell'informazione Ing. Marco Bertini bertini@dsi.unifi.it http://www.dsi.unifi.it/~bertini/ Design pattern Factory Some motivations Consider a user interface toolkit to support

More information

Abstract Classes and Interfaces

Abstract Classes and Interfaces Abstract Classes and Interfaces Reading: Reges and Stepp: 9.5 9.6 CSC216: Programming Concepts Sarah Heckman 1 Abstract Classes A Java class that cannot be instantiated, but instead serves as a superclass

More information

Design patterns. Jef De Smedt Beta VZW

Design 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 information

Socket attaches to a Ratchet. 2) Bridge Decouple an abstraction from its implementation so that the two can vary independently.

Socket 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 information

Design Pattern- Creational pattern 2015

Design Pattern- Creational pattern 2015 Creational Patterns Abstracts instantiation process Makes system independent of how its objects are created composed represented Encapsulates knowledge about which concrete classes the system uses Hides

More information

1 Software Architecture

1 Software Architecture Some buzzwords and acronyms for today Software architecture Design pattern Separation of concerns Single responsibility principle Keep it simple, stupid (KISS) Don t repeat yourself (DRY) Don t talk to

More information

COSC 3351 Software Design. Design Patterns Behavioral Patterns (I)

COSC 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 information

The Design Patterns Matrix From Analysis to Implementation

The 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 information

Design Patterns Reid Holmes

Design 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 information

Produced by. Design Patterns. MSc in Communications Software. Eamonn de Leastar

Produced 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 information

Design Patterns. SE3A04 Tutorial. Jason Jaskolka

Design 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 information

Object Oriented Paradigm

Object 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 information

Introduction to Software Engineering: Object Design I Reuse & Patterns

Introduction 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 information

Application Architectures, Design Patterns

Application Architectures, Design Patterns Application Architectures, Design Patterns Martin Ledvinka martin.ledvinka@fel.cvut.cz Winter Term 2017 Martin Ledvinka (martin.ledvinka@fel.cvut.cz) Application Architectures, Design Patterns Winter Term

More information

Tecniche di Progettazione: Design Patterns

Tecniche di Progettazione: Design Patterns Tecniche di Progettazione: Design Patterns GoF: Builder, Chain Of Responsibility, Flyweight 1 Design patterns, Laura Semini, Università di Pisa, Dipartimento di Informatica. Builder 2 Design patterns,

More information

EINDHOVEN UNIVERSITY OF TECHNOLOGY

EINDHOVEN UNIVERSITY OF TECHNOLOGY EINDHOVEN UNIVERSITY OF TECHNOLOGY Department of Mathematics & Computer Science Exam Programming Methods, 2IP15, Wednesday 17 April 2013, 09:00 12:00 TU/e THIS IS THE EXAMINER S COPY WITH (POSSIBLY INCOMPLETE)

More information

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University Day 4 COMP1006/1406 Summer 2016 M. Jason Hinek Carleton University today s agenda assignments questions about assignment 2 a quick look back constructors signatures and overloading encapsulation / information

More information

A few important patterns and their connections

A 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 information

Plan. A few important patterns and their connections. Singleton. Singleton: class diagram. Singleton Factory method Facade

Plan. 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 information

Keywords: Abstract Factory, Singleton, Factory Method, Prototype, Builder, Composite, Flyweight, Decorator.

Keywords: 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

Singleton Pattern Creational

Singleton Pattern Creational Singleton Pattern Creational Intent» Ensure a class has only one instance» Provide a global point of access Motivation Some classes must only have one instance file system, window manager Applicability»

More information

Software Eningeering. Lecture 9 Design Patterns 2

Software 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 information

Think of drawing/diagramming editors. ECE450 Software Engineering II. The problem. The Composite pattern

Think 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 information

Software 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 Software Design COSC 4353/6353 D R. R A J S I N G H Creational Design Patterns What are creational design patterns? Types Examples Structure Effects Creational Patterns Design patterns that deal with object

More information

Topics in Object-Oriented Design Patterns

Topics 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 information

The GoF Design Patterns Reference

The 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 information

Design Patterns Lecture 2

Design 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 information

g Baking with OO Goodness

g Baking with OO Goodness 4 the Factory Pattern h g Baking with OO Goodness g Get ready to bake some loosely coupled OO designs. There is more to making objects than just using the new operator. You ll learn that instantiation

More information

A Reconnaissance on Design Patterns

A 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 information

CS 349 / SE 382 Design Patterns. Professor Michael Terry January 21, 2009

CS 349 / SE 382 Design Patterns. Professor Michael Terry January 21, 2009 CS 349 / SE 382 Design Patterns Professor Michael Terry January 21, 2009 Today s Agenda More demos! Design patterns CS 349 / SE 382 / 2 Announcements Assignment 1 due Monday at 5PM! CS 349 / SE 382 / 3

More information

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

CSCD01 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 information

Tuesday, October 4. Announcements

Tuesday, 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 information

Design Patterns. (and anti-patterns)

Design 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 information

The Singleton Pattern. Design Patterns In Java Bob Tarr

The Singleton Pattern. Design Patterns In Java Bob Tarr The Singleton Pattern Intent Ensure a class only has one instance, and provide a global point of access to it Motivation Sometimes we want just a single instance of a class to exist in the system For example,

More information

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D.

Software 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 information

CSC207H: Software Design Lecture 6

CSC207H: 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 information

DESIGN PATTERN - INTERVIEW QUESTIONS

DESIGN 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 information

Brief Note on Design Pattern

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 information

CHAPTER 6: CREATIONAL DESIGN PATTERNS

CHAPTER 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 information

TDDB84 Design Patterns Lecture 05. Builder, Singleton, Proxy. pelab

TDDB84 Design Patterns Lecture 05. Builder, Singleton, Proxy. pelab Lecture 05 Builder, Singleton, Proxy Peter Bunus Dept of Computer and Information Science Linköping University, Sweden petbu@ida.liu.se The Constitution of Software Architects Encapsulate what varies.

More information

Lectures 24 and 25 Introduction to Architectural Styles and Design Patterns

Lectures 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 information

CS 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 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 information

COSC 3351 Software Design. Design Patterns Behavioral Patterns (II)

COSC 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 information

Applying the Observer Design Pattern

Applying 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 information

What is Design Patterns?

What 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 information

Software 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 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 information

Design Patterns: State, Bridge, Visitor

Design Patterns: State, Bridge, Visitor Design Patterns: State, Bridge, Visitor State We ve been talking about bad uses of case statements in programs. What is one example? Another way in which case statements are sometimes used is to implement

More information

Improve Your SystemVerilog OOP Skills

Improve Your SystemVerilog OOP Skills 1 Improve Your SystemVerilog OOP Skills By Learning Principles and Patterns Jason Sprott Verilab Email: jason.sprott@verilab.com www.verilab.com Experts in SV Learn Design Patterns 2 Look, you don t need

More information

Modellistica 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 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 information

7. MULTITHREDED PROGRAMMING

7. MULTITHREDED PROGRAMMING 7. MULTITHREDED PROGRAMMING What is thread? A thread is a single sequential flow of control within a program. Thread is a path of the execution in a program. Muti-Threading: Executing more than one thread

More information

Software Design Patterns. Aliaksei Syrel

Software Design Patterns. Aliaksei Syrel Software Design Patterns Aliaksei Syrel 1 Pattern types Creational Patterns Behavioural Patterns Structural Patterns 2 Creational Patterns Creational design patterns deal with object creation mechanisms,

More information

Using Design Patterns in Java Application Development

Using 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 information

Multitasking Multitasking allows several activities to occur concurrently on the computer. A distinction is usually made between: Process-based multit

Multitasking Multitasking allows several activities to occur concurrently on the computer. A distinction is usually made between: Process-based multit Threads Multitasking Multitasking allows several activities to occur concurrently on the computer. A distinction is usually made between: Process-based multitasking Thread-based multitasking Multitasking

More information

Programmazione. Prof. Marco Bertini

Programmazione. Prof. Marco Bertini Programmazione Prof. Marco Bertini marco.bertini@unifi.it http://www.micc.unifi.it/bertini/ Design patterns Design patterns are bug reports against your programming language. - Peter Norvig What are design

More information

2.1 Design Patterns and Architecture (continued)

2.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 information

UNIT I Introduction to Design Patterns

UNIT I Introduction to Design Patterns SIDDHARTH GROUP OF INSTITUTIONS :: PUTTUR Siddharth Nagar, Narayanavanam Road 517583 QUESTION BANK (DESCRIPTIVE) Subject with Code : Design Patterns(9F00505c) Year & Sem: III-MCA I-Sem Course : MCA Regulation:

More information

Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns

Software 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 information

Object oriented programming. Encapsulation. Polymorphism. Inheritance OOP

Object oriented programming. Encapsulation. Polymorphism. Inheritance OOP OOP Object oriented programming Polymorphism Encapsulation Inheritance OOP Class concepts Classes can contain: Constants Delegates Events Fields Constructors Destructors Properties Methods Nested classes

More information

Midterm assessment - MAKEUP Fall 2010

Midterm assessment - MAKEUP Fall 2010 M257 MTA Faculty of Computer Studies Information Technology and Computing Date: /1/2011 Duration: 60 minutes 1-Version 1 M 257: Putting Java to Work Midterm assessment - MAKEUP Fall 2010 Student Name:

More information

Tecniche di Progettazione: Design Patterns

Tecniche di Progettazione: Design Patterns Tecniche di Progettazione: Design Patterns GoF: Builder, Chain Of Responsibility, Flyweight 1 Design patterns, Laura Semini, Università di Pisa, Dipartimento di Informatica. Builder 2 Design patterns,

More information

DESIGN PATTERNS FOR MERE MORTALS

DESIGN PATTERNS FOR MERE MORTALS DESIGN PATTERNS FOR MERE MORTALS Philip Japikse (@skimedic) skimedic@outlook.com www.skimedic.com/blog Microsoft MVP, ASPInsider, MCSD, MCDBA, CSM, CSP Consultant, Teacher, Writer Phil.About() Consultant,

More information

Object-oriented Software Design Patterns

Object-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 information

Lesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014

Lesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014 Lesson 10A OOP Fundamentals By John B. Owen All rights reserved 2011, revised 2014 Table of Contents Objectives Definition Pointers vs containers Object vs primitives Constructors Methods Object class

More information

Template Method, Iterator & Composite

Template Method, Iterator & Composite Template Method, Iterator & Composite Kenneth M. Anderson University of Colorado, Boulder CSCI 4448/5448 Lecture 23 11/10/2008 University of Colorado, 2009 1 Lecture Goals Cover Material from Chapter 8

More information

be 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

be 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 information

What is Design Patterns?

What 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 information

Data Abstraction. Hwansoo Han

Data Abstraction. Hwansoo Han Data Abstraction Hwansoo Han Data Abstraction Data abstraction s roots can be found in Simula67 An abstract data type (ADT) is defined In terms of the operations that it supports (i.e., that can be performed

More information

CIS 110: Introduction to computer programming

CIS 110: Introduction to computer programming CIS 110: Introduction to computer programming Lecture 25 Inheritance and polymorphism ( 9) 12/3/2011 CIS 110 (11fa) - University of Pennsylvania 1 Outline Inheritance Polymorphism Interfaces 12/3/2011

More information

Object Oriented Methods with UML. Introduction to Design Patterns- Lecture 8

Object 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 information