Why a class name must be specified in component diagram's interface?

here below is a illustration of relationship I want to show:

  • component Planning provides some callbacks functions, which make Planning to do something.
  • component Prediction requires the callbacks above, shall call these function when particular event is captured.

the thing I don’t understand is, when interface line is drawed in visual paradigm, I must fulfill the class name both in provide and require interface.

another thing puzzle me is, both Prediction and Planning class (including the interface callbacks) are defined in class diagram - the interface notation in component diagram cannot be linked to the Planning and callbacks in the class diagram

Hi trypsin,

Thank you for your post. May I know what you meant by to ‘fulfill a class name’?

About your second question, as I know, class and component are two different elements in UML. If you want to define the attributes and operations for a component, you can define via the specification window of the Component (Right click on a Component and select Open Specification…). If you want to relate a Component with a Class, you can create a model element reference by clicking on the tiny icon at the bottom left of the Component and selecting Add Model Element… from the popup menu, and then select the Class to link to.

Best regards,
Jick Yeung

thanks, your reply helped me.

for the first question: class name fulfill

when an interface (destination or source) is chosen, I must give the interface a class name. I don’t see this requirement in the UML specification.

  • more specifically, I don’t understand why the component’s interface should be a class.


Hi Trypsin,

A required / provided interface is a classifier. The image below is extracted from the UML specification. It shows an alternate presentation of a component and its required and provided interface.

Information about Component and Required/Provided Interface can be found under the Abstract Syntax and Semantics sections of Component (section 11.6.2 and 11.6.3 in UML Spec 2.5.1))

Best regards,
Jick Yeung

1 Like

understood, thanks.