How to draw a metaclass class in UML?

If class A is created by its __metaclass M, what does the arrow look like in UML?

The stereotype syntax seems to be related.

I haven't looked at Python UML tools yet .

+2


source to share


3 answers


The metaclass is drawn using class designation plus stereotype <<metaclass>>

. The relationship between a class and its metaclass can be defined using a dependency relationship between the two (dashed line with an arrow pointing to the metaclass), annotated with a stereotype <<instantiate>>

.



+3


source


This answer is from the UML 2.2 Superstructure Specification :

More class response: "For example, the keyword" create "can appear next to an operation name to indicate that it is a constructor operation, and can also be used to indicate a usage dependency between two classes to indicate that one class instantiates the other." (Pg 690 [706-AdobeReader], Appendix B, No spaces 4th paragraph, 1st position on page) I think this applies to metaclasses.

Stereotype Response: This is kind of an answer, but it doesn't output "create", which is the word you used in your post, but could just be an ambiguous word choice. The designation is a regular line with a filled triangle. I've also seen the keyword <<extend>>

used in tools like Rational Software Modeler. (Pg 657 [673-AdobeReader] Figure 18.3 and 659 Figure 18.5, Profile Section)



You can also clarify if you have the meaning of the meta-class in the definition of the MOF / model definition or in some language or other context.

Let me know if you clarify your question.

+1


source


I would use the dependency on the "metaclass" stereotype. This is not a predetermined stereotype, but should make it clear what kind of addiction it is.

0


source







All Articles