In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the number of Chinese relations in the UML class diagram, which has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to understand it.
There are mainly "association", "aggregation", "compostion" and "dependency" in the UML class diagram.
Several Relations of UML Class Diagram
It is not easy to distinguish between "association", "aggregation", "compostion" and "dependency" in the UML class diagram, and "UMLdistilled" does not explain these relationships very clearly. After reading "Java and patterns" recently, I found that these relationships are described more clearly. Special excerpts are as follows:
1. The relationship between UML class diagrams (association):
1. The association relationship is the connection between classes, which makes one class know the properties and methods of another class.
2. The association can be two-way or one-way. A two-way association can have two arrows or no arrow, and an one-way association can have an arrow.
3. In Java or C++, associations are achieved by using member variables.
2. Aggregation relationship (aggregation) of UML class diagrams:
1. Aggregation relationship is a kind of association relationship, which is a strong association relationship.
2. Aggregation is the relationship between the whole and the parts. for example, a car is made up of engines, tires and other parts.
3. The aggregation relationship is also realized through member variables. However, the two classes involved in the association relationship are on the same level, while in the aggregation relationship, the two classes are on different levels, one representing the whole and the other representing the part.
4. Association and aggregation are indistinguishable only from the syntax of Java or C++, and the logical relationship between the classes involved must be examined.
3. The composition relation of UML class diagram (composition):
1. The composite relationship is a kind of association relationship, which is stronger than the polymerization relationship.
2. It requires that the object that represents the whole in the ordinary aggregation relationship is responsible for the life cycle of the object that represents the part.
4. Dependency relationship (dependency) of UML class diagram:
1. Dependency is also the connection between classes.
2. Dependence is always one-way.
3. Dependency relationship is embodied as local variable, parameter of method or call to static method in Java or C++ language.
PublicclassPerson
{
Publicvoidbuy (Carcar)
{
...
}
}
Thank you for reading this article carefully. I hope the article "how many Chinese Relations in the UML Class Diagram" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.