There are 13 formal diagrams in UML, but there are not many commonly used diagrams. When using UML for software development, we should focus on software design rather than UML, therefore, a software design does not need to use all the diagrams in UML. UML is just a tool that assists us with software design.
Everyone is different. I usually use six types of graphs, but only three are commonly used.
Friends who read this blog post should have a certain understanding of object-oriented, so we should know the following equation:
Class = attribute (member variable) + behavior (member method)
For example, humans have attributes such as name, gender, and age. They have behaviors such as eating, drinking, pulling, scattering, and sleeping.
In fact, there are three commonly used types: use case diagram, class diagram, sequence diagram, and activity diagram.
Use case diagram: analyze the requirements and obtain the class diagram.
Class diagram: class diagram is introduced from the use case diagram, and the member variables and member methods of each class are analyzed. For example, humans
Sequence diagram: Implements message transmission between objects to complete corresponding functions. For example, Li Si and Zhang San said: the Key is required to open the door. Zhang San gives the key to Li Si and Li Si opens the door. Three objects: Door, Zhang San, and Li Si deliver messages to complete the door opening function.
650) This. width = 650; "src =" http://s4.51cto.com/wyfs02/M02/8A/8E/wKioL1g0EfmDrJO2AAAOhqaKDrU912.png "Title =" 5.png" alt = "wkiol1%efmdrjo2aaaohqakdru912.png"/>
Activity diagram: the logical implementation flowchart of the member methods in the class, which is generally represented by activity diagrams. For example, how do humans eat food?
650) This. width = 650; "src =" http://s4.51cto.com/wyfs02/M01/8A/8F/wKioL1g0E1bCf4C9AAATcyS9vUs899.png-wh_500x0-wm_3-wmp_4-s_2287699026.png "Title =" 6.png" alt = "wkiol1jwe1bcf4c9aaatcys9vus899.png-wh_50"/>
Second, three types of diagrams are also commonly used: state chart, deployment chart, and writing chart.
Status chart: describes the state of the object from initialization to recovery, and the State experienced throughout the life. The state of the object is as follows: children, youth, and elders.
Deployment diagram: implements the physical operation and communication of the program, that is, how to deploy the program after it is developed for your use.
Collaboration diagram: it is useless, because the sequence diagram that can be described by the collaboration diagram can be described. However, the sequence chart is also listed because it has the same function as the sequence chart and is important.
To develop a software, you must first know what development is for and what problems to solve. That is, the requirement analysis section. The most common requirement analysis is the use case diagram: User case digram
650) This. width = 650; "src =" http://s4.51cto.com/wyfs02/M00/8A/8E/wKioL1g0DdTxwQFoAAED7OCi4Hk983.png "Title =" 1.png" alt = "wkiol11_ddtxwqfoaaed7oci4hk983.png"/>
Then, we can get the class diagram through requirement analysis.
650) This. width = 650; "src =" http://s4.51cto.com/wyfs02/M01/8A/92/wKiom1g0DlDSijC6AAJcHGBSU3E771.png "Title =" 2.png" alt = "wkiom11_dldsijc6aajchgbsu3e771.png"/>
After a class graph is obtained, an object is generated by the class, and every function in the program is a collaboration between objects. Therefore, the object-oriented method is also called the message-object method. Objects work together to deliver messages and complete functions.
650) This. width = 650; "src =" http://s1.51cto.com/wyfs02/M00/8A/92/wKiom1g0DujCjjJeAADdAkG61Wo329.png "Title =" 3.png" alt = "wkiom11_dujcjjeaaddakg61wo329.png"/>
The flowchart of implementing a function in each object, or behavior in each class (member method), and method is usually represented by an activity diagram.
650) This. width = 650; "src =" http://s2.51cto.com/wyfs02/M00/8A/92/wKiom1g0D3CjSYdcAAEiKwg2jSI524.png "Title =" 4.png" alt = "wkiom1127d3cjsydcaaeikwg2jsi524.png"/>
This article from the "Xi xianxiao" blog, please be sure to keep this source http://sunshine2624.blog.51cto.com/3959438/1875515
Introduction to common UML legends