Interaction diagram < go > in UML

Source: Internet
Author: User
Tags dashed line

Transfer from >>http://blog.csdn.net/mingxuanyun/article/details/8572128

Interaction diagrams are used to describe how objects in a system interact, that is, how a set of objects are communicated.

an interaction diagram consists of a set of objects and their relationships, including: What objects are needed, what messages are sent between objects, what role initiation messages are sent, and in what order.

Classification of interactive graphs:

The interaction diagram is divided into two types: sequence diagram and collaboration diagram.

  • Sequence diagram-emphasizes the sequence of events for messages
  • Collaboration diagram-emphasizes the interaction between objects

A sequence diagram describes the time order in which messages are passed between objects, which is used to denote the order of behavior in a use case.

sequence diagrams, including chronological order, do not include object contact. That is to say, in order to build a sequence diagram, we only need to take into account the sequence of system behavior, but not the relationship between them. It is possible to draw the behavior between objects in chronological order.

in UML , a sequence diagram describes the interaction between objects in a system by a two-dimensional graph. Where the longitudinal axis represents time and the horizontal axis represents the object that participates in the interaction.

the composition of the sequence diagram:

    1. -Objects and roles: the rectangle above. In the interaction diagram, the object that participates in the interaction can be both a concrete thing and a prototype thing. As a specific thing, an object represents something in the real world.
    2. Lifeline and control Focus: Each object has its own lifeline, and the object lifeline is a vertical dashed line to indicate that an object exists for a period of time
    3. Message: Is the communication between objects, which can be either a signal or an action call.

there are several forms of the message:

  1. Call: Represents an action that invokes an object. Can be a call between objects, or you can make calls to the object itself.
  2. Return (return) Returns a value that represents the called object returned to the caller.
  3. Sendsend): Object sending signal, different from call , the invocation is a mechanism of synchronization, and the signal is an asynchronous mechanism. That is, when the object a Call object ba After the message is sent, it will wait for b After executing the method that was called and then continuing, if the object a sent a signal to the object bA
  4. -Create (creat) creation means the beginning of the object lifeline,
  5. Destruction (destory) is usually connected to the end of life symbol of the target object

How messages are represented: messages from one object to another are represented by a message line that spans the object lifeline, including the reflexive message

Classification of messages:

Synchronization: To a certain extent can be regarded as a single thread, the thread after requesting a method, just wait for this method to reply to him, or he will not go down execution.

Async: To some extent, it can be seen as a multi-threaded. After you have requested a method, continue with the other methods.

PS: In general, the simple message is OK.

Collaboration diagrams: Emphasize organizations that participate in interactive objects.

The relationship between a collaboration diagram and a sequence diagram:

    • The two are semantically equivalent.
    • They can transform each other.
    • The focus of the two is different:
    1. Sequence diagram emphasizes time order
    2. Collaboration diagrams focus on the relationships between objects.

Interaction diagram < go > in UML

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.