Profile Diagram
Extend UML semantics for domain-specific modeling by defining custom stereotypes, metaclasses, and tagged attributes.
| 1 | dialect uml; |
| 2 | |
| 3 | uml::profile_diagram "Cloud Architecture Stereotypes & Metamodel Profile" { |
| 4 | schema { |
| 5 | profile @CloudNativeProfile [label: "Cloud-Native Infrastructure Profile"] { |
| 6 | metaclass @Component; |
| 7 | metaclass @Class; |
| 8 | metaclass @Node; |
| 9 | |
| 10 | stereotype @Microservice [label: "«microservice»"] { |
| 11 | pub runtime: String; |
| 12 | pub replicaCount: Integer = 3; |
| 13 | pub isStateless: bool = true; |
| 14 | } |
| 15 | |
| 16 | stereotype @DatabaseInstance [label: "«database_instance»"] { |
| 17 | pub engine: String; |
| 18 | pub encrypted: bool = true; |
| 19 | pub backupWindowHours: Integer = 24; |
| 20 | } |
| 21 | |
| 22 | stereotype @ServerlessFunction [label: "«serverless»"] { |
| 23 | pub memoryMb: Integer = 512; |
| 24 | pub timeoutSeconds: Integer = 30; |
| 25 | } |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | flow { |
| 30 | Microservice -> extends metaclass Component; |
| 31 | DatabaseInstance -> extends metaclass Node; |
| 32 | ServerlessFunction -> extends metaclass Component; |
| 33 | } |
| 34 | } |
| 35 | |
Errors: 0 | profile-diagram
Core Syntax Reference
| Construct | Purpose |
|---|---|
stereotype @Microservice; | Define custom UML stereotype extensions |
metaclass @Class; | Reference base UML metaclasses |