Universal Entity Formula
The single consistent 6-slot declaration grammar shared across all 15 Dhi diagram types.
Instead of inventing 15 incompatible syntaxes, every Dhi diagram type follows the exact same 6-slot Universal Entity Formula for declaring nodes, participants, states, ports, frames, and classifiers.
The 6-Slot Entity Formula
Universal Entity Formula (Slots 1–6)
Keyword [Modifier] @Identifier [: Type] [AttributeBag] ( "{" Body "}" | ";" )| Slot | Role | Example |
|---|---|---|
| 1. Keyword | Entity kind in the active diagram type | lifeline, class, state, action, node, frame |
| 2. Modifier | Optional prefix modifier before @Identifier (E007 / E010) | actor, abstract, initial, subsystem, cylinder |
| 3. @Identifier | Mandatory @-prefixed unique identifier (E012) | @User, @OrderService, @Idle |
| 4. : Type | Optional classifier/type annotation where permitted (E008) | : Order, : MatchingEngine |
| 5. [AttributeBag] | Key-value metadata & ... spread tokens | [label: "API", ...WIDE_GRID] |
| 6. Body / ; | Either { ... } block body or terminating ; (E004 / E009) | { ... } or ; |
Cross-Diagram Examples
Identical 6-slot structure across Sequence, Class, State, Activity, and Generic diagrams
// Sequence diagram
lifeline service @AuthSvc [label: "OAuth Server"];
// Class diagram
class abstract @BaseEntity [label: "Entity"] {
pub id: UUID;
}
// State machine
state @Active {
self.enter: "startTimer()";
}
// Activity swimlane partition
frame partition @author [label: "Content Author"] {
action @DraftArticle [label: "Compose Initial Draft"];
}
// Generic diagram
node cylinder @Storage [label: "Object Store"];