Class diagrams: abstract vs concrete classes
Introduction
An abstract class cannot be instantiated directly — it defines a skeleton of attributes and methods that its subclasses must implement. A concrete class inherits from the abstract class and provides full implementations. This article shows how to model this pattern in both PlantUML and Mermaid.
PlantUML
1 | abstract class Animal { |
The abstract keyword declares the abstract class, and {abstract} marks abstract methods. extends denotes inheritance.
Mermaid
1 | classDiagram |
Mermaid uses the <<abstract>> stereotype label to mark abstract classes, and <|-- for generalization (inheritance).
Side by side
| Feature | PlantUML | Mermaid |
|---|---|---|
| Abstract class declaration | abstract class Name |
class Name { <<abstract>> } |
| Abstract method | {abstract} +method() |
+method() void (no body) |
| Inheritance | A extends B |
`A < |
| Visibility | + public, # protected |
+ public, # protected |
Wrap-up
PlantUML’s abstract keyword makes abstract class syntax more compact, while Mermaid requires an explicit <<abstract>> label. Both clearly express the core OOP concept: an abstract class defines a contract, and concrete classes provide the implementation.
- Title: Class diagrams: abstract vs concrete classes
- Author: puml.online
- Created at : 2026-10-16 09:00:00
- Updated at : 2026-12-06 10:29:22
- Link: https://puml.online/en/blog/class-diagram-abstract-concrete/
- License: This work is licensed under CC BY-NC-SA 4.0.