Unified Modeling Language (UML)

Source: Internet
Author: User

 

Why Modeling

The model is abstract and simplified to reality, and modeling is to make us better understand the system.

When a project needs to be completed by many people, cooperation is required, and a division of labor is required for cooperation. The corresponding model is applied for different personnel or different periods in the process, we can narrow down the scope of the problem to guide us to better complete our work.

The "we" here refers to all software development-related personnel, not only software design and development personnel, but also customers, project management and testing personnel, all those people who want to know about the system. In addition to making the system clearer, the model established by software developers can help other software developers and other system personnel understand the system.

In general, modeling has four goals:

Visualization: Express a certain aspect of the system or system in a more intuitive form.
  Description: The model can describe the structure or behavior of the system in detail.
  Guiding functions: The model can guide us to construct a system.
  Docized: The model document the decisions we make.

 

Why?UML

Unified Modeling Language (UML) is a language used to visually model software-intensive systems. UML is a standard language used to describe, visualize, and document products of object-oriented development systems.

First, UML integrates the basic concepts of many modeling language methods in the past, and these basic concepts are mostly the same as those of other object-oriented technologies. Therefore, UML must be a simple and consistent modeling language that users of these and other methods are willing to use. Secondly, UML is not only a simple convergence of the above methods, however, on the basis of these methods, we have extensively solicited opinions. After several modifications, UML expands the application scope of existing methods. Third, UML is a standard modeling language, rather than the standard development process. Although the application of UML must be based on the development process of the system, different development processes must be adopted because of different organizations and application fields.

As a modeling language, UML defines two parts: UML Semantics and UML notation.

(1) UML semantic description precise metadata model definition based on UML. The meta-model provides simple, consistent, and general definitions for all UML elements in terms of syntax and semantics, enabling developers to achieve semantic consistency, eliminate the impact of the best expressions that vary from person to person. In addition, UML also supports the extension definition of the metadata model.

(2) UML notation defines the notation of UML symbols, which provides a standard for System Modeling by developers or development tools using these graphical symbols and text syntax. These graphical symbols and texts express application-level models. In terms of semantics, they are examples of UML meta-models.

UML's precise meta-model definition and simple and unified Symbol Representation are also widely used.

 

Main content of UML

The important content of the standard modeling language UML can be defined by the following five types of diagrams (9 in total:

The first type isUse case diagramDescribes the system functions from the user's perspective, and points out the operators of each function.

The second type isStatic Graph(Static digoal)Including class diagram, object diagram, and package diagram.

The class diagram describes the static structure of the class in the system. It defines not only the classes in the system, but also the relationships between classes, such as association, dependency, and aggregation. It also includes the internal structure of the class (attributes and operations of the class ). A class chart describes a static relationship that is valid throughout the lifecycle of the system.

An object graph is an instance of a class graph. It uses almost the same ID as a class graph. Their difference is that the object graph shows multiple object instances of the class, rather than the actual class. An object graph is an instance of a class graph. Because the object has a lifecycle, the object graph can only exist in a certain period of time in the system.

A package consists of packages or classes, indicating the relationship between the package and the package. A package chart is used to describe the layered structure of the system.

Category 3:Behavior diagram (Behavior digoal),Describes the dynamic model of the system and the interaction between the components.

WhereStatus chartDescribes all possible states of the object of the class and transfer conditions of the State when an event occurs. Generally, a status chart is a supplement to a class chart. In practice, you do not need to draw a state chart for all classes. You only need to draw a state chart for classes that have multiple states and their behaviors are affected by the external environment and change.

  Activity diagramDescribes the activities that meet the requirements of the use case and the constraints between the activities. This helps to identify parallel activities.

The fourth type isInteraction diagram (Interactive digoal),Describes the interaction between objects.

WhereSequence ChartDisplays the dynamic cooperative relationship between objects. It emphasizes the order in which messages are sent between objects and displays interactions between objects;

Cooperation DiagramDescribes the collaboration relationships between objects. The collaboration diagram is similar to the sequence diagram. It displays the dynamic collaboration relationships between objects. In addition to information exchange, the cooperation diagram also displays objects and their relationships.

If time and order are emphasized, the sequence chart is used. If the relationship between upper and lower levels is emphasized, the cooperation chart is selected. These two types of graphs are called interaction graphs.

Category 5:Implementation Diagram(Implementation diation).

WhereComponent DiagramDescribes the physical structure of code parts and their dependencies. A component may be a resource code component, a binary component, or an executable component. It contains information about logical or implementation classes. A widget graph helps you analyze and understand the degree of interaction between widgets.

  Configuration chartDefine the physical architecture of software and hardware in the system. It can display the actual computers and devices (expressed by nodes) as well as the connection relationships between them, as well as the connection type and dependency between components. Place executable parts and objects inside the node to display the correspondence between the node and the executable software unit.

From the application perspective, when the object-oriented technology is used to design the system,First, describe the requirement. Second, create a static model of the system based on the requirement to construct the structure of the system. The third step is to describe the behavior of the system.The models created in step 1 and Step 2 are static, including the use case diagram, class diagram (including package), object diagram, component diagram, and configuration diagram, is a standard modeling languageUMLStatic Modeling Mechanism. The model created in step 3 can be executed, or indicates the time sequence status or Interaction relationship during execution. It consists of four diagrams: status chart, activity chart, sequence chart, and joint drawing. It is a standard modeling language.UMLDynamic Modeling Mechanism. Therefore, the main content of the standard modeling language UML can also be summarized into two categories: Static Modeling Mechanism and dynamic modeling mechanism.

 

Application fields of UML

The purpose of UML is to describe any type of system in the form of object-oriented graphs, with a wide range of application fields. The most common model is to build a software system, but it can also be used to describe systems in non-software fields, such as mechanical systems, enterprise organizations, or business processes, and information systems that process complex data, industrial systems that have real-time requirements, or industrial processes. In short, UML is a general standard modeling language that can model any system with static structures and dynamic behaviors.

In addition, UML is applicable to different stages from Requirement Specification descriptions to testing after the system is completed during system development.

In the demand analysis stage, use cases can be used to capture user requirements. Use Case modeling to describe the external roles interested in the system and their functional requirements for the system (Use Case. In the analysis phase, the main concepts (such as abstraction, classes, and objects) and mechanisms in the problem domain need to be identified and their relationships need to be described using UML class diagrams. To implement use cases, classes need to collaborate, which can be described using the UML dynamic model. In the analysis phase, only the objects in the problem domain (concepts in the real world) are modeled, classes that define technical details in software systems (such as those that handle user interfaces, databases, communication, and concurrency) are not considered ). These technical details will be introduced in the design phase, so the design phase provides more detailed specifications for the construction phase.

Programming (constructor) is an independent stage. Its task is to convert classes from the design stage into actual code using object-oriented programming language. When using UML to build analysis and design models, we should avoid converting models into a specific programming language. In the early stage, the model was just a tool for understanding and analyzing the system structure. It was difficult to establish a simple and correct model to consider the coding problem too early.

The UML model can also be used as a basis for testing. Systems usually need to undergo unit testing, integration testing, system testing, and acceptance testing. Different test teams use different UML diagrams as the basis for testing: class diagrams and class specification descriptions for unit testing; component diagrams and contract diagrams for integration testing; the system test uses an example diagram to verify system behavior. the acceptance test is performed by the user to verify that the results of the system test meet the requirements identified during the analysis phase.

In short, the standard Modeling Language (UML) is applicable to describing any type of system with object-oriented technology. It is also suitable for testing and maintenance at different stages of system development, from Requirement Specification Description to system completion.

 

This article only learns everything. It is an excerpt. If there are similarities, please forgive me.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.