Introduction to UML (1) Class Diagram

Class diagram

● Represents the characteristics of the
class ● The class diagram describes the characteristics of multiple classes, interfaces, and the cooperation and interaction between objects
● It is composed of one or more rectangular areas, and the contents include:
-- Type (class name)
-- Attribute (optional)
-- Operation (optional)


is a Person class in the example below,
from top to bottom are the class name, attribute, and operation.




+ means public
- means private

operations should put some important business here. Ordinary setters and getters do not need to be placed here.

It should be noted here that the format of uml for the definition of objects and methods is different from that of Java.
The type of the -name:String
counterpart is shown in the form of a colon + type after the name.

The method is changeString(name:String):String
The last: String indicates that the returned object is of type String.







==============================Inheritance================
uml diagram Indicates the inheritance relationship between classes and classes, represented by straight lines and triangular
arrows . As shown in the figure below,
Child1 and Child2 both inherit Parent



Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326710373&siteId=291194637