Component (UML)
A component in the Unified Modeling Language represents a modular part of a system that encapsulates the state and behavior of a number of classifiers. Its behavior is defined in terms of provided and required interfaces, is self-contained, and substitutable. A number of UML standard stereotypes exist that apply to components.
A component has an external and internal view, also known as “black-box” and “white-box”, respectively. In its external view, there are public properties and operations. For its internal view, there are private properties and realizing classifiers and shows how external behavior is realized internally.
A component may be replaced at design time or run-time by another if and only if their provided and required interfaces are identical. This idea is the underpinning for the plug-and-play capability of component-based systems and promotes software reuse. Larger pieces of a system‘s functionality may be assembled by reusing components as parts in an encompassing component or assembly of components, and wiring together their required and provided interfaces.
A component acts like a package for all model elements that are involved in or related to its definition, which should be either owned or imported explicitly. Typically the classifiers related to a component are owned by it.
Components of a system are modeled by means of component diagrams throughout the development life cycle and successively refined into deployment and run-time.
In diagrams, components are shown as a rectangle with the keyword «component». Optionally, in the right hand corner a component icon can be displayed. This is a rectangle with two smaller rectangles protruding from its left hand side. If the icon symbol is shown, the keyword «component» may be hidden as seen to the side.
Component Diagrams
In Unified Modeling Language (UML), a component diagram depicts how components are wired together to form larger components or software systems. They are used to illustrate the structure of arbitrarily complex systems.
Overview
A component diagram allows verification that a system’s required functionality is acceptable. These diagrams are also used as a communication tool between the developer and stakeholders of the system. Programmers and developers use the diagrams to formalize a roadmap for the implementation, allowing for better decision-making about task assignment or needed skill improvements. System administrators can use component diagrams to plan ahead, using the view of the logical software components and their relationships on the system.
Diagram elements
The component diagram extends the information given in a component notation element. One way of illustrating the provided and required interfaces by the specified component is in the form of a rectangular compartment attached to the component element. Another accepted way of presenting the interfaces is to use the ball-and-socket graphic convention. A provided dependency from a component to an interface is illustrated with a solid line to the component using the interface from a “lollipop”, or ball, labelled with the name of the interface. A required usage dependency from a component to an interface is illustrated by a half-circle, or socket, labelled with the name of the interface, attached by a solid line to the component that requires this interface. Inherited interfaces may be shown with a lollipop, preceding the name label with a caret symbol. To illustrate dependencies between the two, use a solid line with a plain arrowhead joining the socket to the lollipop.