Concepts & Notations
Acknowledgements The material in this tutorial is based in part on: The Unified Modeling Language Reference Manual, 2 nd edition, by James Rumbaugh, Ivar Jacobson, and Grady Booch
Interaction View Interaction Diagram Sequence Diagram Examples
Interaction View Objects interact to implement behavior Two ways to describe interaction focus on individual objects (state machine) focus on interactions of a collection of cooperating objects (interaction view) Provides a more holistic view of the behavior of a set of objects
Interaction Diagram Collaboration Diagram Emphasizes structural relations between objects Sequence Diagram Illustrates how objects interacts with each other Emphasizes time ordering of messages
Sequence Diagram member: LibraryMember book:Book :Book Copy borrow(book) ok = mayBorrow() [ok] borrow(member) setTaken(member)
Sequence Diagram member: LibraryMember book:Book :Book Copy borrow(book) ok = mayBorrow() [ok] borrow(member) setTaken(member) X-Axis (roles) Y-Axis (time)
Sequence Diagram member: LibraryMember book:Book :Book Copy borrow(book) ok = mayBorrow() [ok] borrow(member) setTaken(member) X-Axis (roles) Y-Axis (time) head symbol life line
Sequence Diagram member: LibraryMember book:Book :Book Copy borrow(book) ok = mayBorrow() [ok] borrow(member) setTaken(member) X-Axis (roles) Y-Axis (time) head symbol life line activation double line
Object Naming syntax [instance Name]:[class Name] Life line represents the object’s life during the interaction bDay:Date
Object Active Object holds the root of a stack executions has its own thread of control Passive Object objects that are called by an active object receive control only when called
Object pull : Queueactor1 : …actor2 : … active object passive object
Message An interaction between two objects operation call signaling RPC An arrow between the life lines of two objects Labeled with name arguments control information
Message pull : Queueactor1 : …actor2 : … message
Synchronous Message The routine that handles the message is completed before the caller resumes execution :A:B doYouUnderstand() Caller Blocked return (optional) yes synchronous message
Creation Message An object may create another object via a create() message old:A create() :B Preferred create message
Destruction Message An object may destroy another object via a destroy() message old:Anew:B destroy()
Examples print(doc,client) Client :PrintServer:Queue :Printer Proxy enqueue(job) status job=dequeue() [job]print(job.doc) [job] done(status) Repeated forever with 1 min interludes
Examples print(doc,client) Client :PrintServer:Queue :Printer Proxy enqueue(job) status job=dequeue() [job]print(job.doc) [job] done(status) Repeated forever with 1 min interludes
Examples print(doc,client) Client :PrintServer:Queue :Printer Proxy enqueue(job) status job=dequeue() [job]print(job.doc) [job] done(status) Repeated forever with 1 min interludes
Examples print(doc,client) Client :PrintServer:Queue :Printer Proxy enqueue(job) status job=dequeue() [job]print(job.doc) [job] done(status) Repeated forever with 1 min interludes
Examples print(doc,client) Client :PrintServer:Queue :Printer Proxy enqueue(job) status job=dequeue() [job]print(job.doc) [job] done(status) Repeated forever with 1 min interludes
Examples print(doc,client) Client :PrintServer:Queue :Printer Proxy enqueue(job) status job=dequeue() [job]print(job.doc) [job] done(status) Repeated forever with 1 min interludes
Examples print(doc,client) Client :PrintServer:Queue :Printer Proxy enqueue(job) status job=dequeue() [job]print(job.doc) [job] done(status) Repeated forever with 1 min interludes
Review Time on y-axis, roles on x-axis Activation bars represent executions of procedures Active objects have bars Solid arrowheads: synchronous Stick arrowheads: asynchronous Dashed message lines: return :PrintServer