Component (UML)

from Wikipedia, the free encyclopedia

A component (Engl. Component ) is a model element in the Unified Modeling Language (UML), a modeling language for software and other systems.

description

Components are modular parts of a system that are structured in such a way that they can be replaced by another, equivalent component in their environment. In software development, the corresponding concept is called software components . If you model component-based systems with UML2, the component model element stands for such a closed module.

A component is a specialization of a class , and it can therefore have structural features such as attributes or operations , participate in generalizations and be related to other components via associations .

Example of the graphic representation of a component

However, these properties of one component take a back seat to another. Above all, it is important that a component, as a module, seals off an internal structure from the outside and offers a shell with well-defined docking points from the outside. As a consequence, depending on the point of view, there are two views of a component, a black box view, which only shows the edge, and a white box view, which also shows the internal structure.

The docking points of a component consist of a number of offered and required interfaces and possibly a number of ports .

Similar to a class, a component is drawn as a rectangle with a name. The keyword «component»and optionally a symbol in the upper right corner differentiate the notation of a component from that of a class.

Black box view of a component

Example of a component with three offered and one required interface

The black box view of a component shows the edge of the component and the interfaces that the component offers to the outside world or that it must obtain from other components. All options for the notation of interfaces can be used graphically (see Interface ). The example on the right shows the interfaces offered as lollipops and required as a socket . The representation in classifier form and a dependency relationship between the interface and the component would also be possible .

The example on the right also uses two ports for the specification of the component shells. One of them Management Portis named.

White box view of a component

White box view of a component

The white box view of a component shows the internal structure of the component. In the example on the right, this structure consists of three sub-components Meldungsspeicher, Web-Frontendand Benutzerverwaltung.

It is not essential that the interior of a component can only be modeled as components. It is up to the modeler to find suitable modeling elements for a specific model. In addition to the component, candidates are the part or an encapsulated classifier . Also, classes , interfaces or sub-systems can be used depending on requirements. Subsystems are components that are identified with the keyword «subsystem».

Composition of components

Composition of three components

Components are primarily characterized by the fact that several components can be combined to form a larger system, possibly another component, so that they can be composed in this sense . UML2 models a composition as a dependency relationship between the offered interface of one component and a required interface of the other. The graphic notation does not always show this dependency relationship explicitly. In the example on the right, the component is EmailManagementconnected to the components MailEingangor MailAusgangby combining the appropriate lollipop and socket interfaces. An explicit dependency relationship is identified between the user and the interface Betrieb überwachen.

Differences to UML 1.4

The concept of a component as a model element was already known in UML 1.4. In UML2 it has undergone changes both in the metamodel and in the notation. In UML2, a component is a specialization of Classifier. It can therefore have all kinds of structural features. The notation has been simplified insofar as a component, like many other model elements, can now be represented as a rectangle without the two small additional rectangles on its edge that are customary from UML 1.4.

See also