Oct 200592.3913 Ron McFadyen1 Collaborations Collaboration : an arrangement of classes, links, roles in a context to implement some behaviour. Name of.

Slides:



Advertisements
Similar presentations
Winter 2007ACS-3913 Ron McFadyen1 Duck Example Consider the text example (up to page 6). Each type of duck is a subclass of Duck Most subclasses implement.
Advertisements

Decorator Pattern Applied to I/O stream classes. Design Principle Classes should be open for extension, but closed for modification –Apply the principle.
Chapter 3: The Decorator Pattern
Winter 2007ACS-3913 Ron McFadyen1 Also known as publish/subscribe The essence of this pattern is that one or more objects (called observers or listeners)
18-1 Verifying Object Behavior and Collaboration Role playing – the act of simulating object behavior and collaboration by acting out an object’s behaviors.
CS 210 Introduction to Design Patterns September 12 th, 2006.
Jan 29, Ron McFadyen1 UML Class Diagram Examples Based on well-known patterns Exhibit ways of providing dynamic structures and behaviour.
Jan 15, Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Iteration: a simple cash-only success scenario of Process Sale.
March Ron McFadyen1 Design Patterns In software engineering, a design pattern is a generally repeatable solution to a commonly-occurring problem.
Fall 2009ACS-3913 Ron McFadyen1 Instances & Object Diagrams Joe: Customer Class instances/ Objects An individual object (instance of a class) is shown.
Oct 22, Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – interfaces,
March Ron McFadyen1 Command The command pattern encapsulates a request or unit of work into an object. An invoker will ask a concrete command.
March R McFadyen1 Architecture Architecture involves the set of significant decisions about the organization of a software system, decisions.
Fall 2009ACS-3913 Ron McFadyen Composite Pattern Problem: How do we treat a composition structure of objects the same way as a non-composite object? Arises.
Marcelo Santos 1 Design Patterns Object Oriented Programming Advanced Course 2007.
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 More design patterns.
Fall 2009ACS-3913 Ron McFadyen1 Decorator Pattern The Decorator pattern allows us to enclose an object inside another object. The enclosing object is called.
Feb Ron McFadyen1 Iterator Pattern Recall Generic UML class diagram The iterator is used to access the elements of some aggregate. The aggregate.
Spring 2010ACS-3913 Ron McFadyen1 Weather Station Page 39+ In this application, weather station devices supply data to a weather data object. As the data.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 5: Restaurant.
Feb Ron McFadyen1 Factory Method Iterator Example : Java collection classes represent an example of the Factory Method design pattern. The.
Sept 2004Ron McFadyen Decorator Pattern The decorator pattern allows us to enclose an object inside another object. The enclosing object is called.
Fall 2007ACS Ron McFadyen1 Composite Pattern (see pages ) A composite is a group of objects in which some objects contain others; one object.
Feb Ron McFadyen1 Adapter An adapter converts the interface of a class into another interface the client expects. An adapter lets classes work.
Fall 2009ACS Ron McFadyen1 The context maintains an instance of a concrete state subclass State Pattern Each subclass (concrete state) implements.
March Ron McFadyen1 Design Patterns In software engineering, a design pattern is a generally repeatable solution to a commonly-occurring problem.
Winter 2007ACS-3913 Ron McFadyen1 Classes Represented by a rectangle with possibly 3 compartments Customer Name Address Customer Name Address getName()
Spring 2010ACS-3913 Ron McFadyen1 Command The command pattern encapsulates a request or unit of work into an object. An invoker will ask a concrete command.
Object Collaborations. Objectives: Object Interaction (cont.) You will be able to:  Use sequence diagrams to detail object interactions.
Feb Ron McFadyen1 Iterator Pattern Generic UML class diagram The iterator is used to access the elements of some aggregate. The aggregate interface.
Oct Ron McFadyen Visibility Visibility: the ability of one object to see or have a reference to another object. e.g. When a register object.
Oct Ron McFadyen1 Collaborations Collaboration : an arrangement of classes, links, roles in a context to implement some behaviour. Useful for.
Winter 2015ACS Ron McFadyen1 Composite Pattern A composite is a group of objects in which some objects contain others; one object may represent.
Winter 2007ACS-3913 Ron McFadyen1 Observer Pattern Problem: There are many objects (observers / subscribers) needing to know of the state changes, or events,
March Ron McFadyen1 Singleton pattern Singleton is designed to restrict instantiation of a class to one (or a few) objects. Useful when exactly.
1 RNDS Deployment, Collaborations and Sequences CS : Software Design Winter /T6.
7M822 UML Interaction Diagrams 25 November 2010.
Winter 2011ACS-3913 Ron McFadyen1 Decorator Sometimes we need a way to add responsibilities to an object dynamically and transparently. The Decorator pattern.
Spring 2010ACS-3913 Ron McFadyen1 Duck Example Consider the text example (up to page 6). Each type of duck is a subclass of Duck Most subclasses implement.
March R McFadyen1 Figure 30.2 Layers in NextGen They only have three layers in this architecture Each layer is shown as a UML Package No separate.
9/28/01F-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Design Patterns.
Lecture 16 Composition vs Inheritance: The Final Chapter.
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
Jan Ron McFadyen1 Decorator Sometimes we need a way to add responsibilities to an object dynamically and transparently. The Decorator pattern.
Decorator Pattern So many options!. Starbuzz Coffee  Want to offer a variety of combinations of coffee and condiments  Cost of a cup depends on the.
UML What Is the UML? The Unified Modeling Language (UML) is the successor to the wave of object- oriented analysis and design (OOA&D) methods.
Decorator Explained. Intent Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to sub-classing for.
November Ron McFadyen1 Composite Pattern A composite is a group of objects in which some objects contain others; one object may represent groups,
Interaction Diagrams Interaction Diagrams allow the designer to show how groups of objects collaborate in some behavior. –Interaction Diagrams will show.
Design Jon Walker. More UML ● What is UML again?
10 October, 2007Information System Design IT60105, Autumn 200 Information System Design IT60105 Lecture 17 Collaboration Diagrams.
CS 210 Review October 3, 2006.
What if the milk price goes up? What if a new topping is added? What design principles are violated?
F-1 © 2007 T. Horton CS 4240 Principles of SW Design More design principles LSP, OCP, DIP, … And another pattern Decorator.
Week 5, Day 2: Decorator Decorators Muddiest Point Tomorrow: Quiz on lab reading: web.msoe.edu/hasker/se2811/labs/5/ SE-2811 Slide design:
Collaboration diagrams. Deployment diagrams. Lesson 4.
Week 5, Class 3: Decorators Lab questions? Example: Starbuzz coffee Basic Pattern More examples Design Principles Compare with alternatives SE-2811 Slide.
Builder Introduction. Intent Separate the construction of a complex object from its representation so that the same construction process can create different.
CS 210 Introduction to Design Patterns September 14 th, 2006.
Object-Orientated Analysis, Design and Programming
Dynamic Modeling of Banking System Case Study - II
UML dynamic Modeling (Behavior Diagram)
State Design Pattern 1.
Decorator Pattern.
Figure 30.2 Layers in NextGen
OO Design Patterns - Decorator
Interaction diagrams.
Strategy Design Pattern
Decorator Pattern The decorator pattern allows us to enclose an object inside another object. The enclosing object is called a decorator. The other object.
CSCI 360 Final Review Dr. X.
Presentation transcript:

Oct Ron McFadyen1 Collaborations Collaboration : an arrangement of classes, links, roles in a context to implement some behaviour. Name of pattern appears in a dashed oval. Links to classes shown with participation roles.

Oct Ron McFadyen2 Decorator 1 component decorator Concrete component Concrete decoratorA Concrete decoratorB operation() Client

Oct Ron McFadyen3 Decorator Beverage Condiment Decorator HouseBlend DarkRoast Decaf Espresso MilkMochaSoyWhip Decorator applied to the starbuzz system for managing the different coffee products starbuzz sells.

Oct Ron McFadyen4 Decorator Beverage Condiment Decorator HouseBlend DarkRoast Decaf Espresso MilkMochaSoyWhip Decorator Concrete decorator Concrete component Component Concrete decorator Concrete component The class diagram augmented to show the roles the classes/objects play in the decorator collaboration

Oct Ron McFadyen5 Decorator What is the object diagram for A whipped mocha espresso? A mocha whipped soy decaf? A triple mocha whipped dark roast? Using the code from the text: Draw the sequence diagram to show how a triple mocha whipped dark roast is created. Draw the sequence diagram to show how the description of a triple mocha whipped dark roast is obtained. What is that description? Draw the sequence diagram to show how the cost of a triple mocha whipped dark roast is obtained. What is that cost?