UML (iii) Relationships of elephants

Source: Internet
Author: User

 

I. association)
Associations are expressed in a straight line. They describe the structural relationships between objects of different classes. They connect instances of multiple classes within a period of time. This is different from the dependency relationship, which usually indicates the temporary relationship between two instances.
We can use associations to indicate that an object understands other objects. Simply put, associations describe the existence of another object that has been "known" for a period of time.
2. dependency)
Dependency is represented by a dotted line with arrows. It describes the relationship between the modification of an object and the modification of another object. Different from the association relationship, in addition to knowing the existence of other objects, the dependency will also use the attributes or methods of other objects. From this we can see that dependency is a special association. For example:
Object A stores the ID of object B, but object A does not operate on object B. In this case, object A only knows object B and uses associations; if object A uses the attributes or methods of object B, modification of object B will lead to modification of object A. In this case, A depends on object B.
3. extends)
An extended link is extends with a dotted line with arrows. It is optional rather than necessary. That is to say, there is no extended use case, and the basic use case is complete. However, there is no basic use case, extension cases cannot exist independently. For example, if you receive another call during a call, you can keep the current call and answer the other call. In this scenario, the reserved call case is an extended call case. We can see that whether or not the call needs to be retained depends on the caller's decision, rather than the need. That is to say, we have not used the call retention function and do not affect the call integrity.
4. include: An include link uses a dotted line with arrows to add a version. <strong DD> unlike an extended use case, a use case is required ", instead of "optional", this means that if no use case is included, the basic use case is incomplete. If no basic use case exists, the inclusion use case cannot exist independently.
Let's take a look at an example: we need to first check the account and password, whether it is to get money, transfer money, or change the password, to handle the business at the bank, therefore, the account can be extracted as the common behavior of the preceding business use cases to form a inclusion use case. We can see that this included use case has the reusable significance. If there is a lack of included use cases, money acquisition, transfer and other business use cases, it is incomplete. At the same time, the account cannot be detached from the withdrawal, transfer, and other business cases.
V. realize)
The implementation relationship is represented by a dotted line with a hollow arrow. It is especially used to connect the use case and use case implementation in the use case model, and describes an implementation method of the basic use case.
The basic meaning is: the Basic use case describes a business goal, but there are many possible ways to achieve this business goal. Each implementation path can be expressed by use cases, the implementation Relationship Between the use case implementation and the basic use case.
We can use the telephone fee for example:
In the payment of telephone bills: Three use cases can be used to achieve this goal, namely, the payment in the business office, the payment in the bank, and the deposit of the phone bill.
6. generalization is object-oriented inheritance.
7. aggragation)
A straight line with a hollow diamond arrow is used to represent the child-to-group;
The aggregate relationship is used for class diagrams to express the whole composed of parts. For example, a group of geese is composed of many geese.
Different from the combination relationship, the whole and part are not strongly dependent. Even if the whole does not exist, some still exist.
If the department is revoked, the personnel will not disappear and they will still exist.
8. composition)
A combination is expressed in a straight line with a solid diamond arrow. the arrow points to the child object of the combination, indicating that the child object belongs to the parent object. Composite relationships are used for class diagrams, especially for object Object Relationships and semantics of the entire ownership part. For example, the parent company has many subsidiaries, and the composite relationship is a special aggregation relationship with strong dependencies. If the whole does not exist, the parts will also die out.

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.