Components

In UML modeling, components are model elements that represent independent, interchangeable parts of a system. They conform to and realize one or more provided and required interfaces, which determine the behavior of components.

Components make a system more flexible, scalable, and reusable.

For a component to be replaceable, it must meet the following criteria:
  • The internal structure of the component must be hidden. No dependencies can exist between the contents of the component and other objects.
  • Components must provide interfaces so that external objects can interact it with them.
  • The internal structure of the component must be independent. The internal objects must have no knowledge of the external objects.
  • Components must specify their required interfaces so that they have access to external objects.

In models that depict executable systems, components represent the components that are used during the execution of the system. Examples include COM+ objects, JavaBeans, and Web services.

A component usually takes the name of the part of the system that it represents.

As the following figure illustrates, a component is displayed in the diagram editor as a rectangle that contains the name of the component. It also contains a stereotype of «component» or a component icon, which is a box with two small rectangles that protrude from its side.

A rectangle that contains the name Component1, the word component enclosed by double angle brackets, and the component icon.

Compartments are used to display information about the component's attributes, operations, provided interfaces, required interfaces, realizations, and internal structure.


Feedback