I am a student learning C++. I am creating a UML class diagram for my program that involves inheritance and abstract / concrete classes, but I'm not too sure how I would denote a pure virtual function. Any help is appreciated, thank you!
Asked
Active
Viewed 2.8k times
1 Answers
12
The UML standard does indicate that a behavioral feature (e.g. a method/operation) can have its property isAbstract
set to indicate that it is abstract and has no implementation. There is however nothing about how this should be shown in the diagram.
According to uml-diagrams.org and other sources, in older UML versions (1.4.x), an abstract operation was shown with a name in italic or with a textual {abstract}
marker following its name. The italic convention was widely used (See also here).
The current UML doesn't use anymore use italic and does not indicate how to represent the isAbstract
property. Nevertheless, the {abstract}
marker should still be valid.

Christophe
- 68,716
- 7
- 72
- 138
-
P. 99 of UML 2.5: _The name of an abstract Classifier is shown in italics, where permitted by the font in use_ – qwerty_so Nov 12 '18 at 23:31
-
@ThomasKilian yes, but this applies only to classifiers not to operations. It's very different from the 1.4 standard, where it is explicitly said "*If this class does not implement the operation; that is, does not supply a method, then the operation may be marked as “{abstract}” or the operation signature may be italicized to indicate that it is abstract.*" (page 3-46). – Christophe Nov 12 '18 at 23:48
-
@ThomasKilian the notation of Behavioral Features and of Operations do not mention anymore italic notation (but still underlined for static). But both use the { property... } notation (even if `abstract` is not explicitly mentioned p108-109 + 116). I agree however with you in that I wouldn't be shocked by an italic, since it was so heavily used in the past (including pre-UML notations, e.g. in GoF). – Christophe Nov 13 '18 at 00:07
-
Since both Italic as {abstract} are only indicated in relation to Classifiers, you could maybe update your answer. It currently states that {abstract} should be valid, and there is no indication in the specs that says that it is more valid than italics. – Geert Bellekens Nov 13 '18 at 07:33
-
1I guess the comments above are good enough. Nothing is perfect, even specifications. – qwerty_so Nov 13 '18 at 09:04
-
The second links seems dead. – Aug 23 '21 at 08:11
-
1@Ben_LCDB Thanks for letting me know! We were lucky: the wayback machine has saved a snapshot of the page in 2019. I’ve updated the link accordingly. – Christophe Aug 23 '21 at 09:37