componentsuml

Component diagram - may a component have operations and attributes


I wonder if a Component may have operations and attributes. I never see them on a component diagram, and it also doesn't sound logical, because a component diagram is a high-level diagram.

But I'm not sure, because the UML specification tells me that a Component is a specialization of a Class. So you would think that a Component then also has the ability to have operations and attributes.


Solution

  • yes you can show them in a component diagram, in § 11.6.4 Notation of formal/2017-12-05 :

    The attributes, operations and internal structure compartments all have their normal meaning. The internal structure uses the notation defined in StructuredClassifiers (11.2).

    but the main concerning the components are the provided / required and realized interfaces