UML sơ đồ tương tác

46 1.8K 0
UML sơ đồ tương tác

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

UML Sơ đồ tương tác GV : TS. Trương Quốc Định Sequence Diagrams2 Interaction Diagrams  A series of diagrams describing the dynamic behavior of an object-oriented system.  A set of messages exchanged among a set of objects within a context to accomplish a purpose.  Often used to model the way a use case is realized through a sequence of messages between objects. Sequence Diagrams3 Interaction Diagrams (Cont.)  The purpose of Interaction diagrams is to:  Model interactions between objects  Assist in understanding how a system (a use case) actually works  Verify that a use case description can be supported by the existing classes  Identify responsibilities/operations and assign them to classes Sequence Diagrams4 Interaction Diagrams (Cont.)  UML  Collaboration Diagrams  Emphasizes structural relations between objects  Sequence Diagram  The subject of this tutorial Sequence Diagrams5 A First Look at Sequence Diagrams  Illustrates how objects interacts with each other.  Emphasizes time ordering of messages.  Can model simple sequential flow, branching, iteration, recursion and concurrency. Sequence Diagrams6 Object  Object naming:  syntax: [instanceName][:className]  Name classes consistently with your class diagram (same classes).  Include instance names when objects are referred to in messages or when several objects of the same type exist in the diagram.  The Life-Line represents the object’s life during the interaction  Lifelines are drawn as a box with a dashed line descending from the center of the bottom edge. The lifeline's name is placed inside the box. myBirthday :Date Sequence Diagrams7 Messages  An interaction between two objects is performed as a message sent from one object to another (simple operation call, Signaling, …)  If object obj 1 sends a message to another object obj 2 some link must exist between those two objects Sequence Diagrams8 Messages (Cont.)  A message is represented by an arrow between the life lines of two objects.  Self calls are also allowed  The time required by the receiver object to process the message is denoted by an activation-box.  A message is labeled at minimum with the message name.  Arguments and control information (conditions, iteration) may be included. Sequence Diagrams9 Return Values  Optionally indicated using a dashed arrow with a label indicating the return value.  Don’t model a return value when it is obvious what is being returned, e.g. getTotal()  Prefer modeling return values as part of a method invocation, e.g. ok = isValid()  Model a return value when you need to refer to it elsewhere, e.g. as a parameter passed in another message. Sequence Diagrams10 Synchronous Messages  Nested flow of control, typically implemented as an operation call.  The routine that handles the message is completed before the caller resumes execution. :A :B doYouUnderstand() Caller Blocked return (optional) yes [...]... will iterate minimum the min-int number of times and at most the max-int number of times Besides iteration bounds loop could also have an interaction constraint - a Boolean expression in square brackets UML tries to shuffle the simplest form of for loop and while loop : "after the minimum number of iterations have executed and the Boolean expression is false the loop will terminate" This is clarified . UML Sơ đồ tương tác GV : TS. Trương Quốc Định Sequence Diagrams2 Interaction Diagrams  A series of diagrams. responsibilities/operations and assign them to classes Sequence Diagrams4 Interaction Diagrams (Cont.)  UML  Collaboration Diagrams  Emphasizes structural relations between objects  Sequence Diagram  The

Ngày đăng: 22/10/2014, 22:56

Từ khóa liên quan

Mục lục

  • UML Sơ đồ tương tác

  • Interaction Diagrams

  • Interaction Diagrams (Cont.)

  • Slide 4

  • A First Look at Sequence Diagrams

  • Object

  • Messages

  • Messages (Cont.)

  • Return Values

  • Synchronous Messages

  • Asynchronous Messages

  • Object Destruction

  • Found Message

  • Lost Message

  • Self Message

  • Recursive Message

  • Object state and Constraint

  • Object state and Constraint (cont.)

  • Slide 19

  • Combined Fragment

Tài liệu cùng người dùng

Tài liệu liên quan