"Software Modeling and Design" Study Notes (2) - Overview of UML Notation

"Software Modeling and Design" study notes (2) - UML notation overview
UML notation overview

1. UML notation supports the following diagrams

​ Use case diagram

​ class diagram

​ Object graph

​ Communication Diagram

​ Sequence Diagram

​ State machine diagram

​ Activity diagram

​ Combination structure diagram

​ Deployment diagram

2. Use case diagram

An actor initiates a use case .

3. Class diagram

In a class diagram , classes are depicted by boxes, and static (permanent) relationships between classes are connected by lines connecting the boxes. UML notation supports the following three main types of relationships between classes: association, whole/part relationship, and generalization/specialization relationship.

3.1. Association

An association is a static, structured relationship between two or more classes.

The multiplicity of an association refers to how many instances of one class may be related to a single instance of another class.

3.2. Aggregation and composition levels

It is a whole//part relationship. A composition relationship (represented by a black diamond) is a stronger form of a whole/part relationship than an aggregation relationship (represented by an open diamond).

3.3. Generalization and specialization levels

It is an inheritance relationship.

3.4. Visibility

Visibility refers to whether an element in a class is visible outside the class.

For total visibility use the + sign.

Use the - sign for private visibility .

Protected visibility uses the # sign.

4. Interactive diagram

Communication diagrams and sequence diagrams are two main types of UML and interaction diagrams, which are used to depict how objects interact with each other.

4.1. Communication Diagram

Known as a collaboration diagram , it shows how cooperating objects interact dynamically by sending and receiving messages. Communication diagrams depict the organization of interacting objects.

4.2. Sequence Diagram

Object interaction is depicted in a time series. Has two dimensions, where the objects participating in the interaction are depicted in the horizontal direction, while the vertical direction represents the time dimension.

5. State machine diagram

A state transition diagram is called a state machine diagram.

On arcs representing state transitions, mark them with events [conditions]/actions.

Events cause state transitions, and when the event occurs, the optional Boolean condition must be true for the transition to occur. Optional actions to be performed as a result of the transformation. A state can have any of the following actions:

​The entry action , which is executed when entering the state

​Exit action , which is executed when exiting the state

6. Package

Is a combination of a set of modeling elements. Dependencies and generalization/specialization are possible relationships between packages. Packages can be used to hold classes, objects or use cases.

7. Concurrent communication diagram

In UML, an active object can be used to represent a concurrent object, process, thread or task.

An active object has its own thread of control and can execute concurrently with other objects.

Passive objects do not have a thread of control.

Active objects are depicted in a concurrent communication diagram that depicts a concurrency perspective of the system .

The message interface between tasks in a concurrent communication graph can be asynchronous (loosely coupled) or synchronous (tightly coupled).

8. Deployment diagram

Shows the physical configuration of a system in terms of physical nodes and physical connections between nodes.

9. UML extension mechanism

Three language extension mechanisms are provided, which are constructs, tagged values, and constraints.

9.1. Stereotype

A stereotype defines a building block derived from existing UML modeling elements and tailored to the problem of modeling.

UML stereotype notation allows a modeler to tailor UML modeling elements to a specific problem.

9.2. Tag value

Extends the properties of a UML building block to add new information to it.

9.3. Constraints

Specifies a condition that must be true. In UML, a constraint is an extension of the semantics of a UML element that allows new rules to be added or existing rules to be modified.

Summarize

The main features of UML notation are introduced.

practise

(1) In the use case diagram, how to represent the actor - human icon

**(2)** In the use case diagram, how to represent the use case - ellipse

(3) In a class diagram, how classes are represented - boxes with one, two or three separating regions

(4) In the class diagram, how the association is represented - the solid line between the two class boxes

(5) In the class diagram, how to represent the public visibility of thunder elements - + sign

(6) What are the two types of UML interaction diagrams - sequence diagrams and communication diagrams

(7) What is the interaction diagram used to describe - objects and messages

(8) What is the state diagram used to describe - states and events

(9) What is a UML package - a collection of model elements

(10) What is the deployment diagram used to describe - to describe the physical configuration of the system in the form of physical nodes and physical connections between nodes

Guess you like

Origin blog.csdn.net/weixin_47819574/article/details/119977306