UML Study Notes (2) -- Relationship

Source: Internet
Author: User

In UML, the ways in which things interact (logical or physical) are modeled as links. In object-oriented modeling, there are three most important relationships: dependency, association, and generalization.

(1) dependency is a usage relationship. For example, water pipes rely on water heaters to heat the water they transport.

(2) association is the structural relationship between instances. It can be divided into three types: has a, use a, and creation. There are two types: Included is a part of the content, called composition ); contains is a set, and is contained is an item in the Set, called aggregation ).

(3) generalization connects a general class to a special class, also known as a superclass/subclass relationship or parent/child relationship. For example, an observation window is a window with a fixed large pane, and a courtyard window is a window with a pane open to both sides.

This article mainly describes Association. Association is a structural relationship that specifies the relationship between the object of a transaction and the object of another transaction. Given the association between two classes, you can associate objects of one class with objects of another class. It is completely legal to connect both ends of the Association to the same class. This means that the given object of the class can be connected to other objects of the class. The join of two classes is called binary join. Although not quite common, there can be connections with more than two classes, which are called n-yuan associations. In Graphics, you can draw a solid line connecting the same class or different classes. When you want to represent a structural relationship, use Association.
In addition to this basic form, there are also four types of associated modifiers.
1. Name:

2. Role

3. Multiple

4. Aggregation

Example

The school and department are combined (similar to cars and tires), and the school and students are aggregated (similar to airplanes at airports)

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.