The component diagram illustrates the software components that will be used to build the system.
These may be built up from the class model and written from scratch for the new system, or may
be brought in from other projects and 3rd party vendors.
Components are high-level aggregations of smaller software pieces, and provide a 'black box'
building block approach to software construction. A component can always be considered an
autonomous unit within a system or subsystem. It has one or more provided and required
interfaces (potentially exposed via ports), and its internals are hidden and inaccessible other than
as provided by its interfaces. Although it may be dependent on other elements in terms of
interfaces that are required, a component is encapsulated and its dependencies are designed such
that it can be treated as independently as possible. As a result, components and subsystems can be
flexibly reused and replaced by connecting (“wiring”) them together via their provided and required
interfaces.
The component diagram shows the relationship between software components, their dependencies,
communication, location and other conditions. Component diagrams are used to structure
components in software systems. They examine and manage dependencies between components
or interfaces of components. A component represents a modular, deployable, and replaceable part
of a system.
One or more classifiers that reside on the component typically specify a component. Subsets of
these classifiers explicitly define the component's external interfaces. A component conforms to the
interfaces that it exposes, where the interfaces represent services provided by elements that reside
on the component.
Example: