Easy introduction to UML-Basic Concepts

Source: Internet
Author: User
In 1980s, as object-oriented technology became a research hotspot, dozens of object-oriented software development methods emerged. Among them, Booch, OMT, OOSE and other methods have been widely recognized. However, using different modeling methods is not conducive to communication between developers. While UML unifies the Expression Methods of Booch, OMT, and OOSE, and further develops it. In 1997, UML was adopted by OMG as an international standard for object-oriented modeling language. It incorporates new ideas, new methods, and new technologies in the field of software engineering. UML is not limited to supporting object-oriented analysis and design, but also the entire process of software development starting from requirement analysis. Over the past few years, with its concise and clear expression methods and extraordinary expression ability, UML has been widely recognized by the industry! Currently, in the formal development process of most large enterprises, developers generally use UML to establish models. As a software developer, we must learn UML. Because UML is the unified "text", unified "degree", "volume", and "balance", and does not understand UML, as a national of the unified kingdom of software design, it will be difficult and painful.

The composer will make the music in his head into music, and the architect will make the buildings it designs into a blueprint. These music and blueprint are the Model ), the process of constructing these models is called Modeling ). Software development is like music and architectural design. In the process, it must also present the ideas and results of various workflow processes, such as requirements, analysis, design, implementation, and deployment, this is the modeling of the software system.

So why modeling? The classic answer is: the difference between building a building and building a dog's nest is that building a dog's Nest does not require design. To produce qualified software, you must have a set of specifications on the architecture, processes, and tools.

The current maximum version of UML officially released by OMG is 2.0, which can be downloaded from http://www.uml.org.

UML is composed of graphs and metadata models. graphs are syntaxes and metadata is semantics. UML mainly includes three basic construction blocks: Things, Relationships, and Diagrams ). In this serialization, we will introduce these basic components of UML, UML tools and applications, so that readers can have a preliminary overall impression on UML. In the next several times of serialization, the content is gradually expanded with several instances.

1.1 Basic constructor of UML

1.1.1 transactions

A thing is the final result of entity abstraction and a basic Member of the model. UML contains structured, behavioral, grouped, and annotated things.

(1) Structured things)

A structured thing is a static part of a model. It is used to present elements of concepts or entities. It is the most common element in software modeling. There are seven types of elements:

Class: A Class refers to a set of objects with the same attributes, methods, relationships, and semantics;

Interface: an Interface is a service (operation) provided by a class or component. It describes the actions visible to the class or component;

Collaboration: describes a group of classes that collaborate to complete a specific task and their associated sets. It is used to model the use case;

Use Case: A Use Case defines a business goal achieved by the interaction between the executor (the person who interacts with the system outside the system) and the system to be considered;

Active Class: An activity Class object has one or more processes or threads. The activity class is very similar to the class, but its object represents the behavior of the element and other elements exist at the same time;

Component: A Component is a physical and replaceable Component that contains a set of interfaces, such as COM + and java beans;

Node: A Node is a physical element existing in the system during operation. It represents a computing resource and usually occupies some memory and has processing capabilities.

(2) Behavioral things)

Action thing refers to the dynamic part of the UML model, which represents the "verb" in the statement and represents the part of the model that changes with time and space. There are two types:

Ineraction: an action is composed of a group of objects in a specific context and a series of message exchanges for a specific purpose;

State machine: A state machine is composed of the States of a series of objects.

(3) group things)

You can think of grouping things as a "box" in which the model can be decomposed. Currently, there is only one group thing, namely, package ). Structured, action, and even grouped items can all be placed in a package. Packages are purely conceptual and only exist in the development phase, while components exist during runtime.

(4) Annotational things)

Annotation is the interpretation part of the UML model.

1.1.2 relationship

A link is a way to link things together. UML defines four relationships:

(1) Dependencies: the semantic relationship between two things. Changes in one thing affect the semantics of the other;

(2) Association: Describes the structural relationships between a group of objects, such as the aggregation relationships (describing the structural relationships between the whole and parts );

(3) Generalization: a general-special relationship;

(4) Implementation: The semantic relationship between classes. One Class specifies the contract that is executed by another class.

1.1.3 figure

A graph is a collection of things. UML contains multiple diagrams:

(1) Class digraphs: Class diagrams describe the internal structure of the classes and classes contained in the system and the relationship between classes;

(2) Object digraphs: an Object graph is an instance of a class graph;

(3) Package digraphs: Package charts show dependent class diagrams between packages;

(4) Compoment divisor: A component Diagram describes the physical structure of code components and the dependencies between components;

(5) Deployment Diagram (Deployment divisor): the Deployment Diagram defines the physical architecture of software and hardware in the system;

(6) use case Diagram (Usecase digoal): the use case Diagram describes the functions and requirements of the system from the user's perspective, and shows the relationship between various roles outside the system and various internal use cases of the system;

(7) Sequence Diagram: Sequence Diagram indicates the dynamic cooperative relationship between objects;

(8) Collaboration digoal: A Collaboration Diagram describes the relationships between objects;

(9) Statechart divisor: A state chart describes all possible states of A Class Object and transfer conditions of the State when an event occurs;

(10) Activity Diagram: Activity Diagram describes the execution sequence of various activities in the system.

The preceding 10 types of images can be classified into five types, for example, table 1.1.

Table 1.1 UML chart Classification

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.