1. Home
  2. Docs
  3. Chapter 5. UML & Requirement Diagram
  4. 7. Component Diagram
  5. How to draw a Component Diagram in UML

How to draw a Component Diagram in UML

Download PDF

Component diagram is a kind of UML diagram. shows the physical aspect of an object-oriented software system. It illustrates the architectures of the software components and dependencies between them.

Creating component diagram

Perform the steps below to create a UML component diagram in Visual Paradigm.

  1. Select Diagram > New from the application toolbar.
  2. In the New Diagram window, select Component Diagram.
  3. Click Next.
  4. Enter the diagram name and description. The Location field enables you to select a model to store the diagram.
  5. Click OK.

Creating component

To create component in component diagram, click Component on the diagram toolbar and then click on the diagram.

Create component
A component will be created.

Component created

Assigning stereotypes

Right click on the package and select Stereotypes > Edit Stereotypes… from the pop-up menu.

Assign stereotypes
When the Component Specification window is opened, with the Stereotypes tab selected. The list on the left shows the selectable stereotypes.

If the stereotype you want to use is not on the list, click Edit Stereotypes… button.

Edit stereotypes
Click Add… button in the Configure Stereotypes window.

Add stereotype
Name the stereotype (e.g. application) in the Stereotype Specification window and then click OK button to close it. Click OK button in the Configure Stereotypes window. The added stereotype will then be shown on the list in the Component Specification window. Select it and click Add Selectedbutton. Finally, click OK button to confirm.

Add selected stereotypes
Close the specification window. Stereotypes will be applied to the package.

Stereotypes assigned

Creating provided interface

To create provided interface for a component:

  1. Move your mouse pointer over the source component.
  2. Press on the Resource Catalog button and drag it out.
    Using Resource Catalog
  3. Release the mouse button at the place where you want the interface to be created.
  4. Select Realization -> Interface from Resource Catalog.
    To create a provided interface
  5. A new interface will be created and is connected to the source component. Enter its name and press Enter to confirm editing.
    Interface created

Creating required interface

To create required interface for a component, just follow the steps described above for creating provided interface, but change to select Usage-> Interface in Resource Catalog.

Create required interface

Creating dependency

To create dependency, click Dependency on the diagram toolbar.


Drag from the source shape, move the mouse over the target shape and then release the mouse button to create the dependency.

Dependency created
Continue to complete the diagram.

Showing/hiding attributes in component

Per diagram

You can add attributes to a component. To show/hide the attributes for all components in a diagram:

  1. Right click on the background of the component diagram.
  2. Select Presentation Options > Component Display Options from the popup menu.
  3. Select/De-select Show Attributes to cause attributes to be shown or hidden.

Per component

You can add attributes to a component. To show/hide the attributes for a specific component:

  1. Right click on the desired component.
  2. Select Presentation Options > Show Attributes Mode from the popup menu.
  3. Select Follow Diagram/Show All/Hide All/Customized… from the popup menu. If you have selected the Customized option, you can select the specific attribute(s) to be shown or hidden.

Showing/hiding operations in component

Per diagram

You can add operations to a component. To show/hide the operations for all components in a diagram:

  1. Right click on the background of the component diagram.
  2. Select Presentation Options > Component Display Options from the popup menu.
  3. Select/De-select Show Operations to cause attributes to be shown or hidden.

Per component

You can add operations to a component. To show/hide the operations for a specific component:

  1. Right click on the desired component.
  2. Select Presentation Options > Show Operations Mode from the popup menu.
  3. Select Follow Diagram/Show All/Hide All/Customized… from the popup menu. If you have selected the Customized option, you can select the specific operation(s) to be shown or hidden.