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

**URL:** <https://forums.visual-paradigm.com/t/why-a-class-name-must-be-specified-in-component-diagrams-interface/16598>\
**Category:** UML\
**Tags:** modeling\
**Created:** [February 4, 2021, 5:57am UTC](https://forums.visual-paradigm.com/t/why-a-class-name-must-be-specified-in-component-diagrams-interface/16598 "2021-02-04T05:57:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![trypsin](https://avatars.discourse-cdn.com/v2/letter/t/ee59a6/32.png) [@trypsin](https://forums.visual-paradigm.com/u/trypsin)\
**Post date:** [February 4, 2021, 5:57am UTC](https://forums.visual-paradigm.com/t/why-a-class-name-must-be-specified-in-component-diagrams-interface/16598/1 "2021-02-04T05:57:31Z")

</div>

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

 ![image](https://forums.visual-paradigm.com/uploads/default/original/2X/c/cdd0fd9c061165c538ea8fd4b3cbeca5f490cc93.jpeg)

---

<div class="post-metadata">

**Author:** ![Jick](https://avatars.discourse-cdn.com/v2/letter/j/ea666f/32.png) [@Jick](https://forums.visual-paradigm.com/u/Jick)\
**Post date:** [February 8, 2021, 3:01am UTC](https://forums.visual-paradigm.com/t/why-a-class-name-must-be-specified-in-component-diagrams-interface/16598/2 "2021-02-08T03:01:54Z")

</div>

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.  
 ![image](https://forums.visual-paradigm.com/uploads/default/original/2X/a/a186cb8cb3210e62d335b6eb57fe4b0a78113bd7.png)

Best regards,  
Jick Yeung

---

<div class="post-metadata">

**Author:** ![trypsin](https://avatars.discourse-cdn.com/v2/letter/t/ee59a6/32.png) [@trypsin](https://forums.visual-paradigm.com/u/trypsin)\
**Post date:** [February 13, 2021, 3:53pm UTC](https://forums.visual-paradigm.com/t/why-a-class-name-must-be-specified-in-component-diagrams-interface/16598/3 "2021-02-13T15:53:48Z")

</div>

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.

![图片](https://forums.visual-paradigm.com/uploads/default/original/2X/d/d54167999b165a61fd80894fd272bef3a1108ad0.png)

---

<div class="post-metadata">

**Author:** ![Jick](https://avatars.discourse-cdn.com/v2/letter/j/ea666f/32.png) [@Jick](https://forums.visual-paradigm.com/u/Jick)\
**Post date:** [February 16, 2021, 5:29am UTC](https://forums.visual-paradigm.com/t/why-a-class-name-must-be-specified-in-component-diagrams-interface/16598/4 "2021-02-16T05:29:42Z")

</div>

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.

 ![image](https://forums.visual-paradigm.com/uploads/default/original/2X/9/94300a90b75b722c498bfae663ecd06861a83eea.png)

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

---

<div class="post-metadata">

**Author:** ![trypsin](https://avatars.discourse-cdn.com/v2/letter/t/ee59a6/32.png) [@trypsin](https://forums.visual-paradigm.com/u/trypsin)\
**Post date:** [February 17, 2021, 12:53pm UTC](https://forums.visual-paradigm.com/t/why-a-class-name-must-be-specified-in-component-diagrams-interface/16598/5 "2021-02-17T12:53:16Z")

</div>

understood, thanks.
