DOC PREVIEW
UT Dallas CS 6359 - S10_Chapter_15

This preview shows page 1-2-3-18-19-37-38-39 out of 39 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1What will we learn?UML Interaction DiagramsUML Sequence DiagramsExample: Sequence DiagramUML Communication DiagramsWhich is best?Reading a Sequence DiagramReading a Communication DiagramInteraction Diagrams Are ImportantSequence Diagrams: Lifeline Box NotationSlide 12Sequence Diagrams: MessagesSlide 14Sequence Diagrams: SpecificsSlide 16Slide 17Sequence Diagrams: SpecificsSlide 19Slide 20Slide 21Slide 22Polymorphism and Asynchronous/Synchronous CallsSlide 24Slide 25Communication Diagram NotationMessages in a Communication DiagramCommunication Diagram Messages - NotesMessages NumberingCommunication Diagram Messages – Other QualitiesMessages – Conditional and LoopingMessages – Mutually Exclusive Conditional PathsSequence Diagram - ExampleSlide 34Slide 35Slide 36Slide 37Takeaways from Chapter 15Next …Object-Oriented Analysis and DesignCHAPTERS 15: UML INTERACTION DIAGRAMS1What will we learn?UML Interaction Diagrams – What are they, how to create them2UML Interaction Diagrams There are two types: Sequence and Communication diagrams We will first look at the notation used to represent these, and then later look at important principles in OO design We’ll look at various examples here to learn how to create the diagrams3UML Sequence Diagrams Sequence diagrams are more detailed than communication diagrams They often represent a series of method calls between objects in a system The sequence is represented in what is called “fence format”, and each new object in the sequence is added to the right in the diagram Interactions between objects are usually method calls, but may also be object creation/deletion Especially useful for message flow diagrams, with request-reply pairs4Example: Sequence Diagram5public class A{ private B myB = new B();Public void doOne(){ myB.doTwo(); myB.doThree();}}: A myB : BdoTwodoOnedoThreeUML Communication Diagrams Communication diagrams illustrate object interaction in a graph or network format; objects may be placed anywhere in the diagram6: AmyB : B1: doTwo2: doThreedoOneWhich is best? Depends on the situation; sequence diagrams are mostly preferred because they can capture more detail, but communication diagrams are useful for capturing object interaction on whiteboard or wall sketchesRecall that with Agile UP, much of the design is done at the whiteboard in small groups In general, more notational tools are available for sequence diagrams, and it is usually easier to read the call flows Communication diagrams are much easier to edit and changeJust add in new objects anywhere Communications diagrams are also much more space efficient One possible approach: Start with communications diagram, and if needed, then develop sequence diagrams7Reading a Sequence Diagram We would say “The message makePayment is sent to an instance of Register. The Register instance sends the makePayment message to the Sale instance. The Sale instance creates an instance of a Payment.” Here, “message” is a method call. 8: Register : SalemakePayment(cashTendered)makePayment(cashTendered) : Paymentcreate(cashTendered)Reading a Communication Diagram This diagram has the same intention as the sequence diagram on the previous slide. 91: makePayment(cashTendered)1.1: create(cashTendered):Register :Sale:PaymentmakePayment(cashTendered) direction of messageInteraction Diagrams Are Important Often left out in favor of class definition diagrams, but these diagrams are important and should be done early They describe how the objects interact, and may give clues to the operations and attributes needed in the class diagrams These diagrams are part of the Design Model artifact, and are started in the Elaboration phase in Agile UP10Sequence Diagrams: Lifeline Box Notation11 Basic notation for the entities that make up the sequence diagram – they are called lifeline boxes and represent the participants in the particular sequence being modeled Note that a participant does not need to be a software class, but it usually is for our purposes The standard format for messages between participants is:return = message(parameter: paramerType) : returnTypeType information is usually omitted, as are parameters12sales: ArrayList<Sale>:Sale s1 : Salelifeline box representing an instance of an ArrayList class, parameterized (templatized) to hold Sale objectslifeline box representing an unnamed instance of class Salelifeline box representing a named instancesales[ i ] : Salelifeline box representing one instance of class Sale, selected from the salesArrayList <Sale> collectionx : List«metaclass»Fontlifeline box representing the class Font, or more precisely, that Font is an instance of class Class – an instance of a metaclassrelated exampleList is an interfacein UML 1.x we could not use an interface here, but in UML 2, this (or an abstract class) is legalSequence Diagrams: Messages13 Messages are notated as solid arrows with filled in arrowheads between lifelinesThe lifelines are the dotted lines that extend below each participant box, and literally show the lifespan of the participant The first message may come from an unspecified participant, and is called a “found message”. It is indicated with a ball at the source Messages can be synchronous (sender waits until receiver as finished processing the message, and then continues – blocking call) or asynchronous (sender does not wait, more rare in OO designs) Dashed arrow is used to indicate return of control, e.g. after receipt of synchronous message. May contain a value.14: Register : SaledoAdoBdoXdoCdoDtypical sychronous message shown with a filled-arrow linea found message whose sender will not be specifiedexecution specification bar indicates focus of controlSequence Diagrams: Specifics15 The execution specification bar or activation bar indicates that the operation is on the call stack Usually replies to messages are indicated with a value or a dotted line (see next slide) It is possible to have a message to “self” (or “this”) Sequence diagrams can also indicate instance creation (see later slide) Likewise, instances can be destroyed (indicated by “X” at the end of lifeline)16: Register : Saled1 = getDategetDatedoXaDate: RegisterdoXclear17: Register : SalemakePayment(cashTendered): Paymentcreate(cashTendered)authorizenote that newly created objects are placed at their creation "height": Sale: Paymentcreate(cashTendered)...the «destroy» stereotyped message, with the large X and short lifeline


View Full Document

UT Dallas CS 6359 - S10_Chapter_15

Documents in this Course
Lecture2

Lecture2

63 pages

Lecture3

Lecture3

49 pages

Lecture4

Lecture4

48 pages

Lecture5

Lecture5

47 pages

Lecture6

Lecture6

45 pages

Lecture7

Lecture7

63 pages

Lecture8

Lecture8

77 pages

Lecture9

Lecture9

48 pages

Lecture10

Lecture10

84 pages

Lecture11

Lecture11

45 pages

Lecture12

Lecture12

134 pages

Lecture13

Lecture13

62 pages

Lecture14

Lecture14

76 pages

Project

Project

2 pages

Chapter_1

Chapter_1

25 pages

Load more
Download S10_Chapter_15
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view S10_Chapter_15 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view S10_Chapter_15 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?