UML: Component Diagram

UML: Component Diagram

A component diagram shows the structural relationships between the components of a system, which allows an architect to verify that a system’s required functionality is being implemented by components.

Component

A system can be divided into several components. A component has a set of classes, and it provides several interfaces(API) to other components. An interface can provide some kind of service to other components.

component_diagram

As shown, the componet Students has an interface Data Access, which provides the data access service. And the componet Security has two interfaces Encryption and Access Control, which provide the corresponding services.

Relation

A component can use the services of another component. In the above picture, we can know that:

  • The Students component uses the encryption service of the Security component.
  • The encryption service of the Security component is required by the Students component.

There are two other ways to show this relation:

component_diagram_2

component_diagram_3