Today, we continue to learn about the static and dynamic modeling of UML, we hope that you will learn more about UML modeling over the past two days and apply it in future project development.
Core UML chart Classification: ---> "Solitary nine swords"
Static Modeling: [use case diagram], [class diagram], object diagram, component diagram, and deployment diagram.
Dynamic Modeling: [sequence diagram] (sequence diagrams), status diagram, activity diagram, and collaboration diagram.
Definition and use of core UML diagrams:
I. use case diagram: Displays the core functions of the system and the users or systems that interact with the system.
For example: I believe the previous article has already been clearly written. Here is a simple picture.
=============================== Num1. ========
1. Use Case: The function provided by the system for participants (persons/systems). Generally, it is called a word with attention. -- Elliptic
2. Relationship between use cases --> dotted line:
A) Inclusion relationship: major features include the "include" sub-functions.
B) extended relationships: encapsulate [relatively independent and optional] actions in the basic use case with extended extends. -- Dotted line Reverse
C) General Relationship: general and special (abstract class/interface + Implementation class/subclass) relationships. Returns the reverse arrow of a Real-line triangle.
Ii. Category chart: Describes the features of multiple classes/interfaces and the collaboration and interaction between objects.
A class chart is mainly used to encapsulate data in a class and its operations, and 2 to indicate the relationship between the class and the class.
Here we will talk about these two points. The first point is:Encapsulate data in the class and its operationsLet's take a look at the figure first:
Because Rose is used for drawing, all painting operations are performed on Rose. Note: A simple common class chart is drawn here. The attributes and methods of the class chart are optional, the forward engineering and reverse functions here are a bit similar to an important role of hibernate in Java Web: ing tables into classes or ing classes into tables, of course, this is a class chart rather than a table in the database.
Second point:Indicate the relationship between classes. There are several main relationships between classes: 1. general relationship (inheritance relationship), 2. implementation relationship (relationship between interfaces and implementation classes), 3. association (this is complicated, which includes one-way Association, two-way Association, self-Association, aggregation Association, and combination Association), 4. dependency (rarely illustrated in project development ). The following is an illustration:
1. generalization (inheritance) Relationship: note that the Child class points to the parent class, the arrow is a triangle, and the line is a solid line.
2. Implementation relationship (the relationship between interfaces and implementation classes): This is often used in Java Web. For example, in spring, it is often used to call the object of the DaO layer interface (setxx to generate the interface object through IOC configuration XML) method to process services at the service layer (such as logon and registration ). Note that the implementation class points to the interface, the arrow is a triangle, and the line is a dotted line.
3. Link:
A) one-way Association: As far as chasing mm is concerned, many people seldom find her, but she is not uncommon.
B) two-way Association: for husband and wife, a man can only have one wife, while a woman can only have one husband.
C) Self-Association: Typically, in the menu, the sub-menu and the parent menu encapsulate the same data, but the menu class must have its own reference.
D)Aggregate Association: Aggregation indicates the relationship between the whole and the part. For example, if a car is scrapped, but there are two tires, it can be used by other cars. (When drawing a picture, remember to point to the whole part ):
E)Combination Association: The combination is also the relationship between the whole and the part, with the largest AggregationDifferencesIt means that the entire lifecycle can be controlled. For example, if an IT company goes bankrupt, its part will no longer exist.
Note:: The overall direction is different from the aggregation Association: the combination of the diamond arrow is solid, while the aggregation of the diamond arrow is hollow.
4. Dependency: temporary variables in methods and parameters in method signatures are rarely used in projects, so we will not repeat them here.
It's a bit late. Continue tomorrow. Good night.
Understanding of UML modeling and graphic organization in software development (2)