Copyright W. Howden1 Lecture 6: Collaboration Diagrams.

Slides:



Advertisements
Similar presentations
Testing Object Oriented Programs CSE 111 4/28/20151.
Advertisements

Copyright W. Howden1 Singleton, Wrapper, and Facade Patterns CSE 111.
Object Design Examples with GRASP
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
Template, Command, Iterator and Composite CSE 111 5/9/20151Copyright W. Howden.
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Chapter 1 Object Oriented Analysis and Design. UML, Patterns, and Object-Oriented Analysis and Design  The essential skills for the creation of well-designed,
GRASP Patterns M Taimoor Khan
Copyright W. Howden1 Lecture 7: Functional and OO Design Descriptions.
Lecture 5a: Sequence Interaction Diagrams CSE 111 Copyright W. Howden1.
Copyright W. Howden1 Lecture 3: Elaboration and System Architecture.
Copyright W. Howden1 Lecture 6: Design Evaluation and Intro to OO Design Patterns.
Copyright W. Howden1 Lecture 8: O/O Programming. Copyright W. Howden2 Topics OO Programming Languages Developing programs from Designs –Class and method.
Copyright W. Howden1 Lecture 11: UML Terminology and Additional Models and Notation.
Copyright W. Howden1 Lecture 13: Programming by Contract.
© 2005 Prentice Hall8-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
Copyright W. Howden1 Lecture 4: Sequence Interaction Diagrams.
Copyright W. Howden1 Lecture 14: Callbacks, Singletons and Wrappers.
Copyright W. Howden1 Lecture 5: Collaboration Diagrams.
Collaboration Diagrams. Example Building Collaboration Diagrams.
Lecture 5b: Basic Design Patterns CSE 111. Basic Design Patterns We know our subsystem interface classes and (some of) their methods We need to create.
System Architecture Lecture 3 CSE 111 Spring /22/20151Copyright William E. Howden.
1 Lecture 2: Elaboration Tasks and Domain Modeling.
Copyright W. Howden1 Lecture 15: Generalization, Polymorphism and States.
1 Lecture 1: Processes, Requirements, and Use Cases.
Copyright W. Howden1 Lecture 2: Elaboration Tasks and Domain Modeling.
Copyright W. Howden1 Lecture 12: State Chart Models.
Copyright W. Howden1 Lecture 4: Elaboration Tasks and Domain Modeling.
Lecture a: Additional UML Models: Package, Activity, Deployment Lecture b: Generalization, Aggregation and Additional Domain Model Notation Copyright W.
Object-Oriented Analysis and Design
Objectives Explain the purpose and objectives of object- oriented design Develop design class diagrams Develop interaction diagrams based on the principles.
Copyright W. Howden1 State Models and the State Pattern.
Lecture 7: UML Class Diagrams CSE 111 7/15/20151Copyright W. Howden.
SE-565 Software System Requirements More UML Diagrams.
Designing with Interaction and Design Class Diagrams Chapters 15 & 16 Applying UML and Patterns Craig Larman With some ideas from students in George Blank’s.
SEQUENCE DIAGRAM Prepared by: T. Fatimah Alageel.
Chapter 13 Starting Design: Logical Architecture and UML Package Diagrams.
Systems Analysis and Design in a Changing World, Fifth Edition
Interaction diagrams Sequence and collaboration diagrams.
12 Systems Analysis and Design in a Changing World, Fifth Edition.
1 SAD2 - UML 4 th Lecture Class Diagram in Construction Phase Patterns Case Study Lecturer: Dr Dimitrios Makris
Architecture GRASP Realization of use cases in interaction diagrams Design class diagram Design ( how )
Requirements To Design--Iteratively Chapter 12 Applying UML and Patterns Craig Larman.
1 ITEC 3010 “Systems Analysis and Design, I” LECTURE 10: Use Case Realizations [Prof. Peter Khaiter]
Chapter 6 Use Cases. Use Cases: –Text stories Some “actor” using system to achieve a goal –Used to discover and record requirements –Serve as input to.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 9: Interaction.
Systems Analysis and Design in a Changing World, 3rd Edition
Activity & Class Modeling Labs Discussion p3 T120B pavasario sem.
GRASP: Designing Objects with Responsibilities
Collaboration Diagrams CSIS3600. What is a Collaboration Diagram Collaboration diagrams illustrate interactions between objects The collaboration diagram.
What to remember from Chap 13 (Logical architecture)
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour UML Sequence Diagram.
Domain Classes – Part 1.  Analyze Requirements as per Use Case Model  Domain Model (Conceptual Class Diagram)  Interaction (Sequence) Diagrams  System.
Com S 362: Object-Oriented Analysis and Design From Design To Code.
OO Design Roshan Chitrakar. Analysis to Design Do the RIGHT thing Do the RIGHT thing Requirement Analysis Requirement Analysis Domain Modeling with addition.
1 SEQUENCE DIAGRAM EXAMPLE The domain model, showing the navigability of the associations, and the Reserve video (staff scenario) use-case description.
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
McGraw-Hill/Irwin© 2008 The McGraw-Hill Companies, All Rights Reserved Chapter 17 Object-Oriented Design and Modeling Using the UML.
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
Sequence diagrams Lecture 5. Main terms  Interaction  Life line  Activation  Executable behavior and derived behavior  Messages  Trajectory  Frame.
 Sequence Diagrams Introduction.  Sequence Diagrams  Review Schedule Sheridan.
Lecture 4: Elaboration Tasks and Domain Modeling
Chapter 11: Collaboration Diagram - PART1
DESIGN MODEL: USE-CASE REALIZATIONS WITH GRASP PATTERNS
Dynamic Modeling: Defining Classes
Requirements To Design In This Iteration
Lecture 4: Sequence Interaction Diagrams
Starting Design: Logical Architecture and UML Package Diagrams
Presentation transcript:

Copyright W. Howden1 Lecture 6: Collaboration Diagrams

Context - 1 Interaction sequence diagrams show: –interactions of actors with the whole system (via the GUI/View layer/subsystem) –interactions between subsystems illustrates how the GUI/View sends messages to other subsystems, and how they cooperate to perform some responsibility Copyright W. Howden2

Context - 2 Messages received by subsystems –in our design, messages received by the interface class for a subsystem –corresponds to a method in the interface class (i.e. an instance of it) being executed –corresponds to a task/request/event to which the subsystem must respond Copyright W. Howden3

Context - 3 Subsystem responses –for each request, we have to design how the subsystem will respond –creation of new subsystem classes to fulfill those responsibilities design for change design for intellectual manageability use design patterns and basic design patterns Copyright W. Howden4

5 Collaboration Diagrams Use for subsystem and class design Will use to show event responses –Event  receiving a message how should the entity (e.g. subsystem/subsystem- interface) react to this? Diagrams will show auxiliary objects that we will create as part of the design –leads to definition of new subsystem classes

Copyright W. Howden6 Collaboration Diagram Components Objects Messages –One object sends a message to another message Sequencing of messages –various notations can be used here

Copyright W. Howden7

8 Message Sequence Notation Don’t number first message, we are showing how the object responds to this initial event Complicated situations: –Conditional branching –Nesting of (sub) operations –Compound conditionals

Copyright W. Howden9 Notation: Conditionals Alternative choices of message flows 1. Precede messages with constraints/guards E.g. [userName == name] ……. 2. Use lettered notation to indicate alternative message flows E.g. 2a, 2b; 3a, 3b in the example

Copyright W. Howden10 Conditionals Example Used to indicate choices based on specified conditions. Either 1a or 1b is done, then 2 is done

Copyright W. Howden11 Nesting and Sub-Operations Nested inside the response to message m1, is the sending of messages m2 then m3, done before “returning” from m1

Copyright W. Howden12 Compound Conditions How to number structures such as? if a then if b then {c, d} else e else g Nested numbering already used up for sub- operation nesting so just repeat the condition

Copyright W. Howden13

Copyright W. Howden14 Notation - Names Lower case –Specific: objects, messages, instances instances, instance variables Upper Case –General: Classes, Types, Associations in Domain Models

Copyright W. Howden15

Copyright W. Howden16 Notation - Iteration Use star notation to indicate repetition of a message –Iterated sequence of messages: match iterated conditions, possible ambiguity Stacked icons indicate object collections Additional notation: anonymous objects

Copyright W. Howden17

Copyright W. Howden18 Notation: Object Creation Diagrams show messages from one object to another How to show creation of an object? Notational convention: send it a create message

Copyright W. Howden19 Discovery of Classes and Methods Collaboration Diagrams show objects for which we will develop classes Messages that are sent to Classes/Objects will be methods in the classes

Copyright W. Howden20 Collaboration Diagrams for DS Assume three level design: GUI, DL (Business or Domain Logic) and DB (Data Base) Assume a single interface class for each subsystem: GUI, DL, DB Start with DL

Domain Logic Classes Start with interface class DomainLogic During construction of collaboration diagrams –Discover new, needed methods for the class –Create new classes/objects needed to help fulfill some responsibility Copyright W. Howden21

Domain Logic Event Responses Events/messages to be handled by dL (Domain Logic Interface) –logOn() –getUserType() –getCurrentUName() Design choices shown on following collaboration diagram Copyright W. Howden22

Copyright W. Howden23

Copyright W. Howden24 Expert & Creator Pattern Uses –DL creates LogOn because it has the initialization data, and records instances of LogOn event –LogOn will have the information necessary to determine user type, so it will be given this expert responsibility –It has the information necessary to determine the name of the logged on user so will have this responsibility also 6/28/2015

More DL Event Responses dL will have to deal with the following event/messages –getDate() –isMemberber() –getMemberData() Design Choices shown on following diagram Copyright W. Howden25

Copyright W. Howden26

Copyright W. Howden27 Expert and Creator Pattern Uses –DL creates LogOn because it has the initialization data and records instances of LogOn event –LogOn will have the information necessary to determine user type, so it will be given this expert responsibility –It has the information necessary to determine the name of the logged on user so will have this responsibility also 6/28/2015

More Complex Diagrams Following slide shows dL response to setMemberData() event/message Interfaces with both its own subsystem classes and other subsystem interface Copyright W. Howden28

Copyright W. Howden29

Design Decisions for DomainLogic Necessary DomainLogic methods –logOn, getCurrentUName, getUserType –getDate, isMember, getMemberData –setMemberData New objects/classes created –LogOn, DateRequest, MemberData Copyright W. Howden30

Designing Subsystem Classes LogOn is one of the classes we decided to create inside the DomainLogic subsystem The dL interface class for DL sends messages to this class How will it respond to the event/messages it must take the responsibility for? Shown in following Collaboration diagrams Copyright W. Howden31

LogOn Class Copyright W. Howden32

Copyright W. Howden33

Design Decisions for LogOn LogOn methods –create(name) –getUserName() –initialize() –getUserType() Copyright W. Howden34

Copyright W. Howden35 DL Design Motivation Where did these objects and these ideas for the design come from? 1. Messages sent from GUI –GUI collaboration diagrams show GUI will respond to user initiated events identified in sequence diagrams 2. Principles of good design –2.1 Design evaluation –2.2 Design patterns

GUI Classes Start with GUI interface class Collaboration Diagrams –Discover needed methods for the class –Create new classes/objects needed to help fulfill some responsibility Copyright W. Howden36

Copyright W. Howden37 Collaboration Diagrams and User Interface Design Messages are a little different –Come from actor actions such as pressing a button other GUI objects which may create them and send a message to become visible Following (partial) set of diagrams does not deal with case where user is ADMIN

Copyright W. Howden38

Copyright W. Howden39 Design Decisions for GUI New Classes –Objects appearing in GUI collaboration model MessageDialog, LogOnDialog, DaterOptionSelectionDialog –When made visible (with show()) a GUI object can respond to events Additional collaboration diagrams will show their responses, and additional classes

More GUI Collaboration Diagrams 1 Diagrams for Classes that receive messages/events from :GUIFrame Shows their responses to events –from actors –from other GUI objects Copyright W. Howden40

Copyright W. Howden41

Copyright W. Howden42

Copyright W. Howden43

Copyright W. Howden44

Copyright W. Howden45 Design Decisions for DaterOptionSelectionDialog New Classes for setMemberData message –SetMemberDataDialog New Classes for getADateButton message –SelectDaterPrefsDialog, MessageDialog, SelectDateePropsDialog, DaterPreferences

More GUI Collaboration Diagrams 2 Collaboration diagrams for classes receiving messages/events from classes that receive messages/events from GUIFrame –From DaterOptionSelectionDialog setMemberDataButton alternative –SetMemberDataDialog getADateButton alternative (only first is shown) –SelectDaterPrefsDialog, MessageDialog, SelectDateePropsDialog, DaterPreferences Copyright W. Howden46

Copyright W. Howden47

Copyright W. Howden48

Design Decisions SetMemberDataDialog –New Classes DateeData –necessary methods SelectDaterPrefsDialog –additional methods for daterPreferences setReligion, setGender Copyright W. Howden49

Copyright W. Howden50 Additional GUI Diagrams GUIFrame, for full set of functionality, will need a branch for UserType = ADMIN This will send a show() message to an object called –AdminOptionSelectionDialog leading to new classes and additional collaboration diagrams

Copyright W. Howden51 Collaboration vs Sequence Diagrams Equivalent: it is possible to transform one kind of diagram into the other –Rational Rose: automated tool Sequence diagrams: clearly show –ordering of messages in time –linear interaction structure Collaboration –good for free form create of new messages and classes during design process

Assignment 5 Construct collaboration diagrams for your subsystem interface classes (Phase 1) Construct collaboration diagrams for the more complex classes that are created by the subsystem interface classes (and more complex ones created by them,....) Copyright W. Howden52