# Class hierarchy (Nomnoml) Nomnoml's whole syntax is brackets and arrows. It is the quickest way to sketch a class model, and it has a distinctive look that suits a design note. --- ## What this example shows * Directives controlling direction and spacing. * Compartments, separated by pipes. * Inheritance, composition and association arrows. --- ## A worked example Open it, edit it, or copy the source below. ![Class hierarchy (Nomnoml)](https://help.gocapable.com/images/att1424228466.svg) The source, which you can paste into a new diagram and edit: ``` #direction: down #spacing: 40 #fill: #f8fafc #lineWidth: 1 [Payment| amount: Money; currency: string| authorise(); capture() ] [Payment] <:- [CardPayment| last4: string; scheme: string ] [Payment] <:- [BankTransfer| iban: string ] [CardPayment] +-> [Card| last4: string; expiry: date ] [Order| id: uuid; status: OrderStatus| total() ] o-> [Payment] [Order] +-> [OrderItem| quantity: int; unitPrice: Money ] ``` --- ## Making it your own * Directives at the top control the whole diagram; there is no per-node styling to learn. * Pipes separate compartments, semicolons separate the lines inside one. * For sequence and activity diagrams, use PlantUML. --- ## Related [Architecture diagram (Pikchr)Each object placed relative to the last.](https://help.gocapable.com/diagrams/architecture-diagram-pikchr.html) [Signal timing (WaveDrom)Clock, chip select and data, character by character.](https://help.gocapable.com/diagrams/signal-timing-wavedrom.html) [More languagesBack to the rest of these examples.](https://help.gocapable.com/diagrams/more-languages.html) --- _Specialists. Borrow one when you need it._