1 July 1998 Rev 1.0 Introduction to UML
Introduction to UML
A Practical Approach to Product Development
July 1998 Introduction to UML Slide 2
Introduction to UML A Practical Approach to Product Development - - PDF document
Introduction to UML A Practical Approach to Product Development Description This seminar is designed to help you get started using the Unified Modeling Language (UML) as a visual design tool using a development process. A simple case
July 1998 Introduction to UML Slide 2
July 1998 Introduction to UML Slide 3
DoD Contracting
! OO Mentoring ! UCA Framework System Engineering ! Distributed Computing Infrastructure
RABA Technologies, Inc http://www.raba.com/~jcstaff JHU/APL OOP/C++ Instructor jcstaff@raba.com
DoD Contracting
! OO Mentoring ! Software Development
RABA Technologies, Inc JHU/SCS OOP, C++, Java instructor michele.moore@raba.com
July 1998 Introduction to UML Slide 4
July 1998 Introduction to UML Slide 5
July 1998 Introduction to UML Slide 6
July 1998 Introduction to UML Slide 7
Design methods popularized in 70’s & 80’s Technical community inundated with models, methodologies, notations by early 90’s Standardization was needed, but no one was willing to champion the cause and make it successful; many were opposed to the idea OOPSLA ‘94 Grady Booch and James Rumbaugh announced the merging of their methods OOPSLA ‘95 revealed the first public description of the Unified Method, with Ivar Jacobson joining the duo During 1996, the “Three Amigos” worked on the new method, renaming it as the Unified Modeling Language (UML) In January ‘97, UML was proposed to OMG as a standard to facilitate the interchange of models; UML 1.1 adopted by OMG in Nov ‘97
July 1998 Introduction to UML Slide 8
July 1998 Introduction to UML Slide 9
UML Class Association Generalization Aggregation Booch Class Uses Inherits Containing Coad Class & Object Instance Connection Gen-Spec Part-Whole Jacobson Object Acquaintance Association Inherits Consists of Odell Object Type Relationship Subtype Composition Rumbaugh Class Association Generalization Aggregation Shlaer/ Mellor Object Relationship Subtype N/A
July 1998 Introduction to UML Slide 10
July 1998 Introduction to UML Slide 11
July 1998 Introduction to UML Slide 12
(v1.2 in draft)
July 1998 Introduction to UML Slide 13
July 1998 Introduction to UML Slide 14
July 1998 Introduction to UML Slide 15
July 1998 Introduction to UML Slide 16
Identify key domain abstractions … classes integrating:
Attributes Behavior (responsibilities, methods) Messaging
! providing logical independence between client and object
Polymorphism
! providing physical independence between client and implementation
Consider relationships … integrating classes and objects to form higher levels of abstraction
Association (“Uses, Needs”) Aggregation (“Has-A”) Inheritance (“Is-A”)
Begin constructing your models
July 1998 Introduction to UML Slide 17
!Book [Title]
!BookIface { void setTitle(String value); }
!PersistentBook : BookIface { -> DB }
July 1998 Introduction to UML Slide 18
July 1998 Introduction to UML Slide 19
July 1998 Introduction to UML Slide 20
Show the external actors and their connection to the functionality (use cases) of the system Use cases provide the basis of communication between sponsors/customers and implementers in the planning
Capture some user-visible function May be small or large Achieves a discrete goal for the user
Student Billing System Register for Courses
July 1998 Introduction to UML Slide 21
Show the static structure of the domain abstractions (classes) of the system Describe the types of objects in the system and the various kinds of static relationships that exist among them
Associations Derivations
Show the attributes and
the constraints for the way objects collaborate
StudentInfo major ProfessorInfo tenureStatus StudentSchedule dateUpdated : char* semester : char* change( ) 1 1 NewCourseForm (from Interfaces) 1 Curriculum 1..* Course newCourse( ) getInfo( ) 1 1 creates 1 1..* RegistrationUser name IDNumber
July 1998 Introduction to UML Slide 22
Shows the breakdown of larger systems into a logical grouping of smaller subsystems (e.g, Coad/Yourdon’s Subject Layer) Shows groupings of classes and the dependencies among them A dependency exists between two elements if changes to the definition of one element may cause changes to the other
University Artifacts Interfaces Database global
July 1998 Introduction to UML Slide 23
Show the sequential flow of activities
typically in an operation also in a use case or event trace
Complement the class diagram by showing the workflow of the business (aka “Flowchart”) Encourage discovery of parallel processes which helps eliminate unnecessary sequences in business processes
Select Courses Confirm Availability for each chosen course Buy Book Attend Class
July 1998 Introduction to UML Slide 24
Show all the possible states that objects of the class can have and which events cause them to change Show how the object’s state changes as a result of events that are handled by the object Good to use when a class has complex lifecycle behavior
Selecting select a course Confirming select a course course selected course not available Registering Register student for courses all courses confirmed Completed registration db updated
July 1998 Introduction to UML Slide 25
Show the dynamic collaboration between objects for a sequence of messages sent between them in a sequence of time Time sequence is easier to see in the sequence diagram, read from top to bottom Choose sequence diagram when only the sequence of
: Registrar course form : NewCourseForm Sales 101 : Course : Transaction Manager : DBCourse
set info submit for processing newCourse ( ) course saveCourse ( saveCourse ( getInfo (
July 1998 Introduction to UML Slide 26
Show the actual objects and their links, the “network of
Time sequence is shown by numbering the message label
Choose collaboration diagram when the objects and their links facilitate understanding the interaction, and sequence
:Registrar courseForm: NewCourseForm Sales101:Course :TransactionMgr
1: open() 4: newCourse() 2: setInfo() 3: submit() 5: saveCourse()
: CourseDB
6: saveCourse() 7: getInfo() 8: courseCreated()
July 1998 Introduction to UML Slide 27
Show the physical architecture
Highlight the physical relationships among software and hardware components in the delivered system Components on the diagram typically represent physical modules of code and correspond exactly to the packages on a package diagram
Registration System Database Dorm Main Building Library
July 1998 Introduction to UML Slide 28
July 1998 Introduction to UML Slide 29
July 1998 Introduction to UML Slide 30
1 1 PhoneLine 1 0..* CallerMessage 2 Greeting Answer Mode 1 AnsweringMachine 1 1 1 0..* 2 1
July 1998 Introduction to UML Slide 31
Answer Phone Line Play Greeting Update Indicator Play to Output Device Record Caller Message [Message] [No Message] [Call Stopped]
July 1998 Introduction to UML Slide 32
July 1998 Introduction to UML Slide 33
July 1998 Introduction to UML Slide 34
July 1998 Introduction to UML Slide 35
Results
Software Requirements Spec (SRS)
Functional Requirement Data Requirement Use Case Use Case Path Domain Class
breaks down into
helps id helps id mapped to mapped to
July 1998 Introduction to UML Slide 36
1 Greeting Greeting Play( ) 1 1 0..* CallerMessage DateTime Caller Reviewed Message Record( ) Play( ) Delete( ) 1 PhoneLine RingCount Answer( ) Play( ) Listen( ) Hangup( ) 1 1 2 AnswerMode Answer Ring 1 1 1 Mailbox Total Messages New Message Count 1 0..* 1 1 Speaker Play( ) 1 AnsweringMachine 1 1 1 2 1 1 1 1 <<uses>> <<uses>> <<uses>> <<uses>>
July 1998 Introduction to UML Slide 37
Class: CallerMessage Messages are recorded from the caller with associated information. The caller messages are flagged as new until the owner reviews them and are only deleted upon specific request. Attributes: Date Time - The calls is recorded with the date/time at the start of the call. Caller - The caller is identified by the phone company. Reviewed - Any caller message that has been played is considered reviewed. Message - Caller message data must contain a message; empty messages are deleted Behavior: Record - Caller messages are recorded from the phone line and are terminated when the caller hangs up, the maximum message length has been reached, or the
Play - Caller messages are played to the speaker for the owner to listen to. Delete - The owner can delete specific messages. Stop - The play or recording of the caller messages can be stopped by the owner.
July 1998 Introduction to UML Slide 38
Caller Message
1.The Answering System shall provide the capability for an owner to review a caller message. (Req-2, Review Caller Messages) 2.The Answering System shall output the date and time of the caller message to the owner on playback. (Req-11, Review Caller Messages) 3.The Answering System shall output the identity of the caller of the caller message to the owner on playback. (Req-12, Review Caller Messages) 4.The Answering System shall provide the capability for an owner to review new caller messages only. (Req-14, Review Caller Messages)
…etc.
July 1998 Introduction to UML Slide 39
July 1998 Introduction to UML Slide 40
July 1998 Introduction to UML Slide 41
Answer Caller External Caller Take Caller Message <<extends>> Review Caller Message Set Answer Mode Delete Caller Message <<uses>> Record Greeting Play Greeting <<uses>> External Owner <<uses>> July 1998 Introduction to UML Slide 42
Use Case: Answer Caller
answering machine and completes after the call has been completed. This use case is meant to be extended by mode specific processing.
Actors:
Caller
Pre-conditions:
Answering machine is idle
Post-conditions:
Greeting is played to caller Mode-specific processing is performed
Primary Path (Caller Listens to Greeting):
connected to the answering machine.
to reach the answering ring count.
specific processing
Alternate Path (Caller Hangs Up During Greeting):
The caller hangs up during the playing of the greeting. The system recognizes the hang-up, stops the greeting and prepares for the next caller.
July 1998 Introduction to UML Slide 43
Identify package boundaries and allocate primary responsibility of domain classes to a package Break complex use cases into uses relationships that fit within identified packages Identify interfaces for domain classes that cross package boundaries Define event traces for key interactions between packages Resolve Strategic Issues Results
Use Case Path Event Trace Concrete Analysis Scenario Domain Class
ids used to implement
Concrete Use Case Scenario July 1998 Introduction to UML Slide 44
AnsweringSystem + AnsweringMachine + AnswerMode + AnnounceMode + MessageMode IODevices + InputDevice + OutputDevice + PhoneLine + Microphone + Speaker Messages + CallerMessage + Mailbox + Greeting Foundation + Clock + Observer
July 1998 Introduction to UML Slide 45
connected to the phone line.
new call to the current answer mode. 3-4. The answer mode waits for the
caller. 6-8. The answer mode plays the greeting.
any mode-specific processing
: External Caller : PhoneLine : AnswerMode : Greeting 1: Ring ( ) 2: New Call ( ) 3: Ring ( ) 4: New Call ( ) 5: Answer ( ) 6: Play ( ) 7: Play ( ) 8: Greeting Complete 9: Answer Complete ( ) 10: Hangup ( )
July 1998 Introduction to UML Slide 46
Event Trace Script
connected to the phone line.
new call to the current answer mode. 3-4. The answer mode waits for the
caller. 6-8. The answer mode plays the greeting.
perform any mode-specific processing
Use Case Script
connected to the answering machine.
count to reach the answering ring count.
specific processing
July 1998 Introduction to UML Slide 47
: External Caller : PhoneLine : MessageMode : Mailbox : Speaker : Message Indicator message : CallerMessage 3: Create (caller, timeOfCall) 2: CallerId ( ) 4: Record (InputDevice) 5: Listen ( ) 6: Play ( ) 7: Disconnect ( ) 8: Caller Message Complete 9: Record (message) 10: New Message ( ) 1: Answer Complete ( )
July 1998 Introduction to UML Slide 48
caller message. (Req-2, Review Caller Messages)
The IODevices Package shall provide the capability to play audio to a speaker. (Pkg-4) The Messages Package shall provide the capabiliy to play caller messages to an
to the owner on playback. (Req-11, Review Caller Messages)
The Foundation Package shall provide the capability to obtain the time of day. (Pkg-1) The Messages Package shall timestamp caller messages with the time of the call. (Pkg-13) The Messages Package shall play the time of day when a caller message is
July 1998 Introduction to UML Slide 49
message to the owner on playback. (Req-12, Review Caller Messages)
The IODevices Package shall provide the capability to obtain the identity of the
The Messages Package shall record the identity of the caller. (Pkg-14) The Messages Package shall output the identity of the caller when a caller message is played. (Pkg-20)
new caller messages only. (Req-14, Review Caller Messages)
The Messages Package shall provide the capability for an owner to review new caller messages only, (Pkg
July 1998 Introduction to UML Slide 50
Class Design (per customer build)
Identify internal design classes and their interfaces Define Method Traces Results
! Documented in SDD ! Presented at CDR
Class Implementation (per internal build)
Implement classes Unit & Integration Testing
Package Integration
Software Integration Testing (SWIT)
Event Trace Concrete Analysis Scenario Method Trace Concrete Design Scenario Class Design
ids details for used to implement tested by tested by
Code
ids context for
July 1998 Introduction to UML Slide 51
InputDevice Listen( ) Initialize( ) Audio( ) Terminate( ) speaker 0..1 OutputDevice Play( ) Initialize( ) Terminate( ) PhoneLine RingCount Hangup( ) Answer( ) Listen( ) Play( ) Ring( ) Disconnect( ) CallerId( ) Initialize( ) 0..1 Observer Notify( ) (from Foundation) AudioSample PhoneLineImpl MicrophoneImpl SpeakerImpl
July 1998 Introduction to UML Slide 52
: External Caller : PhoneLine : AnsweringMachine : MessageMode : CallerMessage : Mailbox
G1: Ring
F F2: notify (int, void*)
F F3: newCall ( ) 5: CallerMessage (callerId, dateTime) 6: record (InputDevice&)
P4: callerId ( ) 7: listen ( ) Audio
P8: record (CallerMessage&)
F FP P P G F F F F F F L
July 1998 Introduction to UML Slide 53
July 1998 Introduction to UML Slide 54
July 1998 Introduction to UML Slide 55
Functional Requirement Data Requirement Use Case Use Case Path Event Trace Concrete Analysis Scenario Method Trace Concrete Design Scenario Domain Class Class Design
breaks down into
helps id helps id ids used to implement ids details for used to implement tested by tested by
Code
ids context for mapped to mapped to Concrete Use Case Scenario tested by
July 1998 Introduction to UML Slide 56
Requirements Use Cases Use Case Paths Domain Classes Event Traces Class Designs Message Traces Code Unit Test Integration Test Acceptance Testing Customer Customer Representative System Engineer Software Architect Subsystem Lead Developer Subsystem Lead System Engineer
July 1998 Introduction to UML Slide 57
July 1998 Introduction to UML Slide 58
July 1998 Introduction to UML Slide 60
July 1998 Introduction to UML Slide 61
AnsweringSystem IODevices Messages
Messages + CallerMessage + Mailbox + Greeting
+ Public Visibility -/# Non-public Visibility
July 1998 Introduction to UML Slide 62
Class Name and general properties (optional)
! Package (Package::) ! Stereotypes (<< >>) ! Constraints ({ } ) ! Meta-model attributes
Attributes (optional) Operations (optional)
CallerMessage Mailbox { author=“bob” } Greeting <<controller>> AnsweringSystem::AnswerMode IODevices::OutputDevice responsibilities Output Audio IODevices::InputDevice AnsweringMachine {1}
July 1998 Introduction to UML Slide 63
July 1998 Introduction to UML Slide 64
Describing data properties
Describing localized behavior of a class
July 1998 Introduction to UML Slide 65
July 1998 Introduction to UML Slide 66
AnsweringMachine Greeting AnswerMode 1 1 2 1 2 1 1 1 Answer Modes
AnsweringMachine Answer Modes [2]
July 1998 Introduction to UML Slide 67
further describes association between members
role played by associated member
named unnamed
quantity of associated member
unspecified 1 - mandatory 0..1 - optional 0..* (or *) - many # - specified value or range
AnsweringMachine Greeting Answer Mode AnswerMode 1 1 2 1 2 1 1 1 Answer Modes actions are controlled by
July 1998 Introduction to UML Slide 68
An Answering Machine has “2” modes The related Answer Modes play the role
Machine’s “Answer Modes” An Answer Mode is associated with “1” Answering Machine The Greeting plays the role of a “Greeting” There is “1” Greeting per Answer Mode A Greeting is associated with “1” Answer Mode
AnsweringMachine Greeting Answer Mode AnswerMode 1 1 2 1 2 1 1 1 Answer Modes actions are controlled by
Answering Machine “actions are controlled by” Answer Modes
July 1998 Introduction to UML Slide 69
Person Name SSN Company Name 0..* 0..* 0..* 0..* Employment
Employment Hire Date Termination Date Salary
Person Name SSN Company Name 0..* 0..* 0..* 0..*
Use Attributed Class to add properties unique to the association between two classes Use named/unnamed associations where there are no properties unique to the association between two classes
July 1998 Introduction to UML Slide 70
Person CallerMessage Organization {or}
July 1998 Introduction to UML Slide 71
CallerMessage Mailbox 0..* 1 0..* 1 CallerMessage Mailbox 0..* 1 0..* 1
shows side of association that represents the aggregate
A refinement of aggregation showing the aggregate having
Aggregation Composite
July 1998 Introduction to UML Slide 72
dependency shown with <<uses>> stereotype shows a usage relationship between associated classes the association is temporary (created and forgotten during the completion of a behavior)
InputDevice OutputDevice CallerMessage <<uses>> <<uses>>
shown by dashed directed arrow
July 1998 Introduction to UML Slide 73
July 1998 Introduction to UML Slide 74
derived classes (sub-type) comply with base class (type) interface definitions
derived classes (sub-class) reuse or extend base class (class) implementation
Microphone Listen( ) Speaker Play( ) PhoneLine RingCount Hangup( ) Answer( ) Listen( ) Play( ) InputDevice Listen( ) OutputDevice Play( )
July 1998 Introduction to UML Slide 75
Microphone Listen( ) Speaker Play( ) PhoneLine RingCount Hangup( ) Answer( ) Listen( ) Play( ) InputDevice Listen( ) OutputDevice Play( )
InputDevice is the base class of Microphone and PhoneLine Microphone “is-a” type of InputDevice PhoneLine “is-a” type
OutputDevice
July 1998 Introduction to UML Slide 76
July 1998 Introduction to UML Slide 77
AnsweringSystem + AnsweringMachine + AnswerMode + AnnounceMode + MessageMode IODevices + InputDevice + OutputDevice + PhoneLine + Microphone + Speaker Messages + CallerMessage + Mailbox + Greeting July 1998 Introduction to UML Slide 78
Microphone Listen( ) Speaker Play( ) PhoneLine RingCount Hangup( ) Answer( ) Listen( ) Play( ) InputDevice Listen( ) OutputDevice Play( )
July 1998 Introduction to UML Slide 79
InputDevice OutputDevice 0..* CallerMessage DateTime Caller Reviewed Message Record( ) Play( ) Delete( ) Stop( ) <<uses>> <<uses>> 1 1 Mailbox Total Messages New Message Count Record( ) Play( ) 0..* 1 1 1 AnsweringMachine 1 1 2 1 Greeting Answer Mode Greeting Record( ) Play( ) Stop( ) <<uses>> <<uses>> 1 AnswerMode 1 2 1 1
July 1998 Introduction to UML Slide 80
PhoneLine MessageMode Max Message Length New Call( ) AnnounceMode 1 Greeting 1 1 2 AnswerMode Answer Ring New Call( ) 1 1 1 Mailbox 1 1 1 1 1 Speaker 1 AnsweringMachine 1 2 1 1 1 1 1 1 1 Microphone 1 1
July 1998 Introduction to UML Slide 82
July 1998 Introduction to UML Slide 83
shown by oval with name inside or below oval - may also contain compartment for extension points
unit of useful functionality provided by system sequence of actions
External Owner External Caller Review Caller Message Take Caller Message
shown by a stick figure with name
role of an object or objects external to the system one object may play many roles
Answer Caller extension points mode-specific processing
July 1998 Introduction to UML Slide 84
Use Case: Answer Caller This use case begins with a caller ringing the answering machine and completes after the call has been completed. This use case is meant to be extended by mode specific processing.
Answering machine is idle
Greeting is played to caller Mode-specific processing is performed
1.The caller rings the phone line connected to the answering machine. 2.The system waits for the ring count to reach the answering ring count. 3.The system plays a greeting. 4.The system performs any mode-specific processing
The caller hangs up during the playing of the greeting. The system recognizes the hang-up, stops the greeting and prepares for the next caller.
July 1998 Introduction to UML Slide 85
Answer Caller Take Caller Message Play Greeting External Caller <<extends>> <<uses>>
July 1998 Introduction to UML Slide 86
Answer Caller Take Caller Message Play Greeting External Caller <<extends>> <<uses>>
Communicates
actor in a use case
relationship between an actor and a use case Uses
using use case will also include behavior
Extends
case may contain behavior specified by extending use case
July 1998 Introduction to UML Slide 87
Answer Caller External Caller
Participates in Actor: External Caller Use Case: Answer Caller
July 1998 Introduction to UML Slide 88
Answer Caller Play Greeting External Caller <<uses>>
Used Use Case: Play Greeting Using Use Case: Answer Caller includes the same behavior specified in
July 1998 Introduction to UML Slide 89
Answer Caller Take Caller Message External Caller <<extends>>
Extended Use Case: Answer Caller may contain the behavior specified by Extending Use Case: Tale Caller Message
July 1998 Introduction to UML Slide 90
July 1998 Introduction to UML Slide 91
Answer Caller External Caller Take Caller Message <<extends>> Review Caller Message Set Answer Mode Delete Caller Message <<uses>> Record Greeting Play Greeting <<uses>> External Owner <<uses>>
July 1998 Introduction to UML Slide 93
July 1998 Introduction to UML Slide 94
Answer Phone Line Play Greeting Update Indicator Play to Output Device Record Caller Message [Message] [No Message]
[Call Stopped]
July 1998 Introduction to UML Slide 95
Synchronization Bar Guard Decision Activity
Answer Phone Line Play Greeting Update Indicator Play to Output Device Record Caller Message [Message] [No Message]
Activity Initial State End State State Transition Synchronization Condition
[Call Stopped]
July 1998 Introduction to UML Slide 96
Review Messages
Play Message
Multiple Trigger
July 1998 Introduction to UML Slide 97
Answer Phone Line Play Greeting Update Indicator Play to Output Device Record Caller Message [Message] [No Message]
Message [new] Object
[Call Stopped]
July 1998 Introduction to UML Slide 98
Answer Phone Line Play Greeting Update Indicator Play to Output Device Record Caller Message [Message] [No Message]
Answering System Messages IO Devices
[Call Stopped]
July 1998 Introduction to UML Slide 99
July 1998 Introduction to UML Slide 101
July 1998 Introduction to UML Slide 102
Foundation
+ Observer IODevices + AudioSample + InputDevice + OutputDevice + PhoneLine
July 1998 Introduction to UML Slide 103
Types (interface)
! defines the signatures of how to communicate with all sub-types
Base Classes (abstract)
! also defines a type ! defines property implementations to be inherited by sub-class class
<<interface>> Observer notify() : void message : AudioCut Message {Abstract} play(device: OutputDevice) : void device.play(message)
July 1998 Introduction to UML Slide 104
Defines type-independent template structure and algorithms
Binds template to a data type
vector Audio <<bind>>
<AudioSample> vector<AudioSample>
July 1998 Introduction to UML Slide 105
object (no underline) class (underlined)
PhoneLineImpl #deviceAddress_ : long #model : string +play (audio : Audio) : <<interface>> OutputDevice +play (audio : Audio) : <<interface>> PhoneLine +hangup () : July 1998 Introduction to UML Slide 106
Contains the i/o port number for the modem
Plays the vector of audio samples to the modem. Will throw a NotReady exception if the modem is not ready or a Hangup exception if the line is hung-up during the play.
July 1998 Introduction to UML Slide 107
Message <<interface>> OutputDevice play (audio : Audio) : void PhoneLineImpl deviceAddress : long play (audio : Audio) : void hangup () : void Message
OututDevice
PhoneLineImpl deviceAddress : long play (audio : Audio) : void hangup () : void
Message PhoneLineImpl deviceAddress : long play (audio : Audio) : void hangup () : void
July 1998 Introduction to UML Slide 109
July 1998 Introduction to UML Slide 110
time
: Device Player : OutputDevice : External Listener 2: Play ( ) 4: Terminate ( ) 1: Initialize ( ) 3: Audio ( )
Message Return Message (optional) Activation (focus of control) Label
July 1998 Introduction to UML Slide 111
:Message Mode :Caller Message :Mailbox Record [Message Not Empty] Record(CallerMessage) [Message Empty]
July 1998 Introduction to UML Slide 112
:Message Mode :PhoneLine Listen() Play() Stop()
July 1998 Introduction to UML Slide 113
:Message Mode :Caller Message Create Record :Control Panel Play Delete Object is created Object is deleted
July 1998 Introduction to UML Slide 114
: External Caller : PhoneLine : AnswerMode : Greeting 1: Ring ( ) 3: Ring ( ) 2: New Call ( ) 4: New Call ( ) 5: Answer ( ) 9: Answer Complete ( ) 10: Hangup ( ) 6: Play ( ) 7: Play ( ) 8: Greeting Complete
July 1998 Introduction to UML Slide 115
: External Caller : PhoneLine : MessageMode : Mailbox : Speaker : (Message Indicator) message : CallerMessage 7: Disconnect ( ) 2: CallerId ( ) 1: Answer Complete ( ) 9: Record (message) 10: New Message ( ) 3: Create (caller, timeOfCall) 4: Record (InputDevice) 5: Listen ( ) 6: Play ( ) 8: Caller Message Complete
July 1998 Introduction to UML Slide 116
Context (structure, relationships, ...) in which interactions occur
Message sequencing between objects
: Device Player : OutputDevice : External Listener 1: Initialize ( ) 2: Play ( ) 3: Audio ( ) 4: Terminate ( )
Message Object Relationship
July 1998 Introduction to UML Slide 117
: Device Player Play ( ) : OutputDevice Devices
:MessageMode Create ( ) : CallerMessage { new }
July 1998 Introduction to UML Slide 118
: External Caller : PhoneLine : AnsweringMachine : MessageMode : CallerMessage : Mailbox
G1: Ring
F F2: notify (int, void*)
F F3: newCall ( ) 5: CallerMessage (callerId, dateTime) 6: record (InputDevice&)
P4: callerId ( ) 7: listen ( ) Audio
P8: record (CallerMessage&)
F F<<global>> <<fieldl>> <<field>> <<field>> <<field>> <<field>> <<field>> <<local>> <<parameter>> <<parameter>> <<parameter>>
July 1998 Introduction to UML Slide 120
July 1998 Introduction to UML Slide 121
Recording entry: set date/time entry: set caller id do: ^InputDevice.Listen New Hangup[ Message not empty ] Reviewed Playing do: ^OutputDevice.Play Idle Deleted Hangup[ Message empty ] Play / set reviewed = true Playing do: ^OutputDevice.Play Idle Play Complete Delete Record
July 1998 Introduction to UML Slide 122
Recording entry: set date/time entry: set caller id do: ^InputDevice.Listen Hangup[ Message not empty ] Hangup[ Message empty ] Record
State Event
Guard Condition Action Activity Event Transition
July 1998 Introduction to UML Slide 123
!^Target Object.Message(arguments)
July 1998 Introduction to UML Slide 124
New Reviewed entry: ^OutputDevice.Play Play / set reviewed = true Play
An Action taken on Play from New State Self-Transition An Action taken no matter how state entered
July 1998 Introduction to UML Slide 125
Hangup[ Message not empty ] Reviewed Playing do: ^OutputDevice.Play Idle Deleted Hangup[ Message empty ] Play / set reviewed = true Playing do: ^OutputDevice.Play Idle Play Complete Delete
July 1998 Introduction to UML Slide 126
Taking Message Recording Playing to Output Device Recording Playing to Output Device
July 1998 Introduction to UML Slide 127
Recording entry: set date/time entry: set caller id do: ^InputDevice.Listen New Hangup[ Message not empty ] Reviewed Playing do: ^OutputDevice.Play Idle Deleted Hangup[ Message empty ] Play / set reviewed = true Playing do: ^OutputDevice.Play Idle Play Complete Delete Record
CallerMessage Caller Reviewed DateTime Record( ) Play( ) Delete( )
July 1998 Introduction to UML Slide 129
July 1998 Introduction to UML Slide 130
Messages AnsweringSystem IODevices
Node Dependency
Connection Components
July 1998 Introduction to UML Slide 131
AnsweringSystem Messages IODevices
InputDevice OutputDevice PhoneLine Greeting CallerMessage Mailbox
Interface
July 1998 Introduction to UML Slide 132
July 1998 Introduction to UML Slide 133
July 1998 Introduction to UML Slide 134
http://uml.systemhouse.mci.com (OMG UML info) http://www.awl.com/cp/awweb.htm (survey of analysis and design methods) http://st-www.cs.uiuc.edu/users/patterns/patterns.html, http://c2.com/ppr/index.html (Patterns info) http://www.rational.com/uml/documentation.html (Rational doc) http://www.rational.com/products/rose/seed (Rational CASE tools)