Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to present an abstract class in UML class diagram

UML class diagram is a handy tool in object-oriented design. I am using it currently and facing presenting an abstract class with UML. I googled it but got nowhere.

So I would like to ask how to express an abstract class in UML class diagram, and it must be able to differentiate from concrete class

like image 363
Rui Avatar asked Sep 05 '17 07:09

Rui


People also ask

How do we represent abstract class in UML?

In UML, the abstract class has the same notation as that of the class. The only difference between a class and an abstract class is that the class name is strictly written in an italic font. An abstract class cannot be initialized or instantiated.

Can UML diagrams show abstract classes?

The names of abstract classes and methods are italicized in UML: An interface can be viewed as an abstract class containing only abstract methods. In Java an interface may not contain fields, private members, or methods.

How do you represent interface in UML diagram?

Interface Notation Interface is represented by a circle as shown in the following figure. It has a name which is generally written below the circle. Interface is used to describe the functionality without implementation.


1 Answers

You have to write the class name in italic :

enter image description here

Here Contexte is an abstract class and Structure is a "concrete" class

P. 99 of the specs says:

The name of an abstract Classifier is shown in italics, where permitted by the font in use. Alternatively or in addition, an abstract Classifier may be shown using the textual annotation {abstract} after or below its name.

like image 136
Loïc Di Benedetto Avatar answered Oct 02 '22 15:10

Loïc Di Benedetto