A detailed description of relationships in UML and representations in Visio

Source: Internet
Author: User

Reprint Address: http://www.cnblogs.com/kittywei/archive/2013/05/15/3079536.html

There are four main types of Uml relationships: dependency, correlation, generalization, and implementation.

The relationship between dependence and relevance is the semantic horizontal relation between things, and generalization and realization are the vertical relations between things.

One: reliance on Dependency

Illustration:----->

Definition: The most loosely-related, one-way, temporary relationship between the things used.

Use the legend: a weak dependency between two things in a static diagram, a component diagram, a deployment diagram, and this illustration.

Second: Association Association

Illustration: This diagram is descriptive in Visio (in a UML static structure, drag a composite legend, and then double-click the legend to appear, in the association end list, the aggregation column is selected for none, and then in the Isnavigable column, select the end of the stroke arrow. Then click OK and the associated legend on the right appears.

Definition: A relatively close relationship between two things.

A structured relationship between entities indicates that objects are interconnected. The arrows are optional and are used to specify navigation capabilities. If there are no arrows, hinting is a two-way navigation capability. The association is converted to an instance-scoped variable. Additional modifiers can be attached to an association. The multiplicity (multiplicity) modifier implies a relationship between instances.

Using legends: Used in static diagrams, other diagrams have similar associations, but are refined to other relationships.

There are two specific types of relationships: aggregation and composition.

1 polymerization Aggregation

Illustration: This diagram is descriptive in Visio (in a UML static structure, drag a composite legend, and then double-click the legend to appear, in the association end list, select the Sharing option in the aggregation column at the arrow end of the row. Then click OK and the aggregation legend on the left appears.

Definition: The relationship between the whole and the individual, the extinction of the individual life cycle does not have much impact on the whole life cycle. has a relationship.

Aggregation is a form of association that represents a global/local relationship between two classes. Aggregation implies that the whole is conceptually at a higher level than the local, and the association implies that two classes are conceptually at the same level. Aggregations are also converted into an instance-scoped variable. The difference between association and aggregation is purely conceptual, and is strictly reflected in semantics. Aggregation also implies that there are no loops in the instance diagram. In other words, it can only be a one-way relationship.

2 Combination Composition

Illustration: This diagram is descriptive in Visio (in UML static structure, drag the composite legend directly)

Definition: The relationship between the whole and the individual, contains a.

A combination is a special form of aggregation that implies a "partial" lifetime responsibility within the "whole". Combinations are also non-shared. Therefore, although the local does not have to be destroyed with the overall destruction, but the overall responsibility to maintain a local survival, or be responsible for destroying it. Local cannot be shared with other whole. However, the whole can transfer ownership to another object, which will then assume the lifetime responsibility.

Aggregation and composition relationships in Visio are referred to as shared and composite relationships, respectively. Mainly used in static diagrams. The diamond is the whole end and the other end is an individual.

Three: Generalization generalization

Illustration: This diagram is descriptive in Visio (in UML static structure, drag the inductive legend directly)

Definition: Special to general relationship. In software development is called the inheritance relationship, is a relationship.

Four: Realize realization

Diagram: This diagram is descriptive in Visio (right-click the class, then select the Shape Display option, then tick the implementation link shown on the left, click OK, select the example diagram, the yellow diamond will appear, click the yellow diamond, and then underline the object to be associated. The dashed arrow line appears).

Definition: The implementation relationship between the classes, which is called the implementation interface in software development, or the implementation relationship between the abstract classes.

In addition, there are 3 relationships in the use case diagram

1: Generalized relationships between participants and participants, which is the inductive legend in Visio.

2: A dependency between the actor and the use case. That is, the communication legend in Visio.

3: Use the correlation between use cases and use cases, that is, drag the extended legend in Visio. You can also use generalization relationships sometimes.

The association is divided into two categories: include relationship, extends relationship.

1) Include relationship: Separate the common steps of several use cases into a contained use case, and the containment relationship between the use cases allows the behavior of the provider use case to be included in the customer use case. The included use case is called the customer use case, and the included use case is referred to as the provider use case. Contains the use case to provide functionality to the customer The popular point is that a complex thing, divided into parts, the whole and part of the inclusion relationship.

2) Extended Relationship: A method that inserts a new behavior into an existing use case. The underlying use case provides a set of extensibility points. These extension points can add new behavior. The extension use cases provide a set of insert fragments. These fragments can be inserted into the extension point of the underlying use case. With a relatively independent and optional action in the base case, encapsulated with an extension (Extension) use case, and then extended from the extension point (Extension points) declared in the base use case, so that the base case behaves more concisely and the target is more focused, I may do the extended event after the base event, It may also not do (new features that are needed in special cases, extension points are special cases). The popular point is an operation, you can have a variety of options, each way can achieve this function. There is an extension relationship between multiple implementations and functional interfaces.

3) Generalization relationship: The generalization relation of use case is similar to the generalization relation of the class, that is, in the use case generalization, the sub-use case represents the special form of the parent use case, the child use case inherits the behavior and the attribute from the parent use case, and can also add the behavior and properties, change the inherited behavior. A child use case can use a section of the parent use case, or it can be overloaded. The parent use case is usually abstract. In practical applications, the generalization relationship is seldom used, and the special behavior in the sub-use case can exist as an alternative stream in the parent use case.

The inclusion and extension processes are similar to the generalization process

Commonality: All of the common use cases are extracted from the public part of the information, as a separate use case, and then through the different methods to reuse the common use case, to reduce the workload of model maintenance

However, the emphasis on the optimization of use case relationship is different. As follows:
Generalization emphasizes the mutual exclusion between sub-cases;
Contains the indirection that emphasizes the inclusion of the use case to the actor service;
The extension focuses on the triggering uncertainty of the extension use case, as detailed below:

Since a use case is a UML representation of a system-provided service, the process of service is inevitable in all use-case scenarios, but occurs in the following two scenarios, according to the conditions of occurrence:

⒈ unconditional occurrence: sure to happen;

⒉ conditional occurrence: May not occur, the occurrence or not depends on the system state;

Therefore, the three kinds of relationship of use case are considered by the system state, the generalization and the inclusion use case belong to the unconditional occurrence use case, and the extension belongs to the conditional occurrence use case. Further, the existence of use cases is to provide services for actors, but the way in which the use cases provide services can be divided into indirect and direct, according to which, the sub-use cases in generalization provide direct services, while the included use cases provide indirect services. Similarly, extension use cases provide direct services, but the occurrence of extension cases is conditional.

Another point to mention is that the sub-use cases in generalization and extension cases in extensions can all exist as a prepared selection stream for basic use case events.

Note: Visio does not have an include relationship by default, you can add it in a way, choose a toolbar UML, select a stereotype, add a row, and click OK. You will then be able to reference this include relationship.

Drag an extension legend, and then double-click, for example, a list include in the stereotype, select Include, and click OK. The text on the extended legend on the right will now change to include.

A detailed description of relationships in UML and representations in Visio

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.