Class Diagram(Class digoal)Introduction
Class graph is an important tool for business structure modeling, and is an important tool for Object-Oriented Analysis (OOA, object-oriented analysis) and object-oriented design (OOP, object-oriented deisgn.
The various business concepts and characters mentioned in the requirements can be viewed as classes after being abstracted. A class can be called a class. A class has many refining perspectives. You need to select a proper angle to summarize things based on the system objectives and business scenarios.
Class recognition:
1. Class Recognition
It is easy to recognize people, things, and concepts in Requirement Analysis as classes. However, for things, such as exams, we may not recognize them as classes. It is generally believed that classes represent static things, and things are dynamic. Classes are not suitable for representation. This is not absolute, starting from the system's goal. Sometimes we need to identify some things, actions, and other dynamic content as a class. When we do a certain management system, and so-and-so refers to a thing, the system actually manages the thing by managing the records of the thing. For example, the examination management system actually manages the examination records. The leave management system actually manages the leave records. To make these things manageable, it is necessary to recognize these things as classes.
2. Relationship between classes
Link:
Where: * indicates the meaning of zero to multiple names, which can also be expressed by numbers. For example, 10 indicates the meaning of 10 names,
1. 100: indicates the meaning of 1 to 100;
Includes two types of relationships: Aggregation and composition)
Aggregation:
Combination:
Aggregation means that if the Department does not exist, the employee can continue to exist, and the combination means that if the department fails, the employee does not exist.
During software requirement analysis, all the contained relationships can be expressed as aggregate relationships. After in-depth analysis, some relationships are determined as composite relationships.
Generalization ):
Dependency: for example, logwapper depends on log,
The so-called dependency, the dependency program is relatively speaking, not necessarily because logwapper cannot "survive" without a log ".
In the specific business logic, logwapper needs logs to assist with the completion of a specific task, which is also dependent.
Class "recursion" relationship and "Triangle" Relationship
Recursive relationships are self-contained relationships. Like folders, folders can contain folders or files.
A triangular relationship is the association between two categories using the third category. For example, a company and employees are associated by labor.
Some of the above content comes from the [fireball UML war Demand Analysis], which is recorded as a learning note
UML learning-class diagram Introduction