Profile diagrams: stereotypes and metadata

Profile diagrams: stereotypes and metadata

puml.online

Introduction

Stereotypes extend class diagram elements with semantic labels, distinguishing roles like “interface”, “service”, “entity”, and “enum” within the same diagram. Both PlantUML and Mermaid support <<stereotype>> notation, but with different details. This post compares syntax and rendering output.

PlantUML version

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
@startuml
skinparam classAttributeIconSize 0

profile UserProfile {
stereotype Entity <<entity>>
stereotype Service <<service>>
stereotype Interface <<interface>>
}

class User as "User" <<entity>>
class AuthService as "Auth service" <<service>>
interface IUserRepo as "User repository" <<interface>>

User -- IUserRepo
AuthService ..> IUserRepo
@enduml

PlantUML’s profile block declares a namespace for stereotypes, and < <type> > annotations follow the class name directly. Common stereotypes like <<entity>>, <<service>>, and <<interface>> can be styled via skinparam directives.

Mermaid version

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
classDiagram
class User {
<<entity>>
+String name
+int id
}
class AuthService {
<<service>>
+login()
+logout()
}
class IUserRepo {
<<interface>>
+findById()
+save()
}
User --> IUserRepo
AuthService ..> IUserRepo

In Mermaid, <<stereotype>> appears as the first line inside a class block, equivalent to PlantUML’s < <type> > annotation. The classDiagram notation supports <<interface>>, <<abstract>>, <<service>>, and other common stereotypes.

Side by side

Feature PlantUML Mermaid
Declaration position After class name as < <type> > Inside class block as first line <<type>>
Profile block Supported via profile {} Not supported
skinparam styling Full control over font/color Themed via CSS
Relationship arrows --, ..>, `< –`

Wrap-up

Both engines share the same core concept — <<type>> denotes a stereotype — but PlantUML adds profile declarations and skinparam fine-tuning for complex enterpriseModelling. Mermaid wins on lightweight, Markdown-friendly authoring for inline documentation.

  • Title: Profile diagrams: stereotypes and metadata
  • Author: puml.online
  • Created at : 2026-10-21 09:00:00
  • Updated at : 2026-12-06 10:29:22
  • Link: https://puml.online/en/blog/profile-diagram-stereotypes/
  • License: This work is licensed under CC BY-NC-SA 4.0.
On this page
Profile diagrams: stereotypes and metadata