In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces how to use UML to draw class diagrams, with a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Using UML to draw Class Diagram Summary
Recently, I finally got an advanced one and started to draw class diagrams with UML. Generally speaking, it is helpful to sort out the ideas before coding. Some materials have been collected and sorted out in the course of use. The following mainly introduces the relationship between several classes in the UML class diagram:
1. Generalization relation
Generalization relationships usually represent inheritance relationships, and the object-oriented term is is-a relations. That means Class2 is a Class1. In C++, we say that Class2 is a derivative of Class1, or that Class1 is the base class of Class2.
two。 Aggregation and composition
When UML draws a class diagram, aggregation and composition usually represent a situation in which one class is a data member of another class, where one end of the diamond is the whole and the other end is the part.
Gathering: just like the relationship between the airport and the aircraft, the airport can have no aircraft, and the aircraft may not be at the airport.
Composition: just like cars and tires, cars must have tires, and tires do not make sense to leave the car.
3. Dependency relationship
Let's take a look at dependency relationships in UML class diagrams. Assuming that the change of class A causes the change of class B, it means that class B depends on class A.
There are three cases of dependencies:
1) Class An is a parameter in Class B methods.
2) Class A sends messages to Class B, which affects the change of Class B.
4. Association
Is the lexical connection between classes so that one class knows the public properties and operations of another class, just like # Include in C++, associations can be one-way and two-way.
Thank you for reading this article carefully. I hope the article "how to use UML to draw Class Diagram" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support 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.