UML Modeling Learning 2:UML basic building blocks

Source: Internet
Author: User

a thing in the UML

Some of the basic graphic symbols that make up the model diagram, which represent some basic object-oriented concepts.

There are four kinds of things in UML structural things (structural things), behavioral things (behavioral things), group things (grouping things),

Annotational Things (note things).

Two four types of things in UML (things) (1) Structural things

Structural things are static parts of a model that represent the representation of a concept or entity and are the most common elements in software modeling, with the following seven types:

Category A (Class)

A class is a description of a set of objects that have the same properties, methods, relationships, and semantics. A class implements one or more interfaces.

UML Diagram Symbols:


b Interface (interface)

An interface describes a service's set of operations for a class or component, which simply defines the specification of a set of operations, and does not give the set of operations

The implementation of the body.

UML diagram Symbols:


C Collaboration (collaboration)

Collaboration defines an interaction that is composed of a group of roles and other elements that work together to provide a collaboration that is more collaborative than all

The sum of the behavior of the element. Therefore, collaboration has structure, behavior, and dimensions. A given class can participate in several collaborations.

UML diagram Symbols:


D Use Cases

A use case is a description of a set of action sequences that the system performs to produce a valuable and observable result for a particular participant.

UML diagram Symbols:


E Active classes (active Class)

An active class is a class whose object has at least one process or thread, so it can control the activity in a pneumatic way.

UML diagram Symbols:

F Component (component)

A component is a physical, replaceable part of a system that follows and provides an implementation of a set of interfaces.  

UML Diagram Symbols:

G-Node

A node is a physical element that exists at run time, and it represents a computable resource that usually has at least one capacity for memory processing. A component Set

Can reside within one node or migrate from one node to another.  

UML Diagram Symbols:


(2) Behavioral matters

Behavioral things are dynamic parts of UML models. They are verbs in the model and describe the behavior that spans time and space. There are two main types of behavior.

Extract

a interaction (interaction)

Interaction is a behavior that consists of messages exchanged between a set of objects that work together to accomplish a particular task in a particular context. An object group

Body of Behavior or behavior of a single action can be described by an interaction.

Interaction involves a number of other elements, including messages, action sequences (behaviors caused by a message), links (connections between objects).

UML Diagram Symbols:


B State Machine

A state machine is a behavior that describes a sequence of states that an object or an interaction undergoes in response to an event during its lifetime. A single class or group of classes

Collaborative behavior can be described using a state machine. A state machine involves a number of other elements, including state transitions (things that are converted) and activities (for a turn

Change response).

UML diagram Symbols:


(3) grouping things

Grouping things is the organizational part of a UML model, and the most important grouping thing is the package.

Packages (Package)

A package is a mechanism for organizing elements into groups , which is the only organizational mechanism in UML.

UML diagram Symbols:


Packages can have other elements, which can be classes, interfaces, artifacts, nodes, collaborations, use cases, and diagrams, or even other packages.

A package forms a namespace. The name of the same element in a package must be unique. Different kinds of elements can have the same name.

(4) Annotate things

Note Things are part of the interpretation of UML models. These annotation things are used to describe, describe, and annotate any element of the model. There's a major annotation thing

Referred to as annotations.

Annotations (note)

An annotation is a simple symbol attached to an element or set of elements to constrain or interpret it.

UML Diagram Symbols:

Comparison of three things (online excerpt)

A few basic tables have been designed here to make comparisons easier and clearer. The parts of the pale yellow patches in these tables are expressed in 1.x and

There are distinct elements in the 2.x, and blue bold characters indicate elements that have a slight difference.

(1) Comparison of structural things

Structured things include classes, interfaces, collaborations, use cases, activity classes, components, nodes, artifacts.

careful observation of table 1, in the structure of things, the difference between the obvious interface (interface), component (components).

1) Careful observation of the two interfaces of the 1.x and 2.x sample diagram, you can see in 2.x, the interface is given two types, the interface of the provider and the requirements of the interface

, which are represented by circles and arcs, represent a reciprocal relationship and are very image.

2) for components, there are also significant differences, in uml1.x, the component with a square to the left with two prominent rectangles to represent, and in UML2.0,

The component has a new representation, as shown in table 1, in fact, UML 2.0 defines a component as a structured class, which means that in a component's internal structure (part)

Collaboration between elements can be modeled to better describe its behavior. The parts are connected through a connector. The port can be used by the component to provide the

and the required interface to increase the package level of the component.

Earlier versions of UML defined a special modeling element called a subsystem that was modeled as a package with an interface. Components are also used in physical

Constructs a model in the architecture. In UML 2.0, components are used in a generalized manner and are used in all parts of the model. In this way, there is no need for special

The elements of the pair are modeled on the system. The independent quadrant for subsystem implementations and subsystem specifications in UML 1.x has become an application in UML 2.0

Independent Stereotypes of the components (<< implementation >> and << specification >>), respectively. Another new component stereotype is the << subsystem >>, which is indicated to be used for large

Model components. Therefore, the meaning of UML components has been extended and changed to a great extent.

In addition, there are artifacts (artifacts) and activity classes (active Class) that change less in structural things.

3) The difference between the products is that it is from the UML1.4 after the emergence of a new structure of things (note: This is according to the author's investigation, remains to be verified), to indicate

A physical component of a system that is often used to represent a file.

4) and the difference between the activity class is that its shape has undergone some changes, the two-layer vertical line instead of bold black-framed lines, more easy to distinguish with the class. Examples of possible references

Figure.

(2) Comparison of behavioral matters

The behavior of a thing includes a message, a state, an action.

observing the behavior in table 2 (Behavior things), you can see things that have changed significantly:

1) Action (actions) This is the new element in UML2.0, which is used to represent the nodes in the original activity diagram, which will be explained in detail in the activity diagram. Hair

Things that have a slight change are:

2) message (Messages), which is basically equivalent to the (interactive) interaction in the original uml1.x, but the name has changed.

3) State (states), which is basically the same as the original uml1.x in the state machine, the name has also changed.

(3) Comparison of grouped things and annotated things

The names and illustrations of things that are grouped and annotated have not changed much, but the functionality of the package has been further expanded and marked as a change

To.



UML Modeling Learning 2:UML basic building blocks

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.