00 - documentation

Draft Notation

A plain-English way to write class diagrams. No angle brackets, no drag-and-drop - you describe classes and how they relate, in sentences a teammate could read out loud, and the canvas builds itself.

Open Playground

01 - quick start

Four things to learn

That's genuinely the whole language. There's no schema to memorize - if you can describe your system out loud, you can already write Draft Notation.

01

Nothing to configure

Name a class

Any word on its own line becomes a class. No keyword, no boilerplate.

02

knows / can

Give it fields & methods

Write "ClassName knows ..." for fields and "ClassName can ..." for methods.

03

Plain-English verbs

Connect classes

Write a sentence like "User has many Post" - the verb decides the arrow.

04

Instant

Watch it render

Paste it into the Playground and the canvas builds itself.

# Start with your first class
User
# Give it fields
User knows id, name: String, email: String
# Give it behaviours
User can login(), getProfile(): Profile
# Describe a relationship - this line alone creates the Post class too
User has many Post

02 - playground

Try it live

Edit the code on the left - the parsed structure updates on the right in real time. Nothing here is sent anywhere; it's the same parser the editor uses.

Live preview
2 nodes1 edges
classUser
+ id
+ name: String
+ email: String
+ login()
+ getProfile(): Profile
classPost
+ id
+ content: String
+ createdAt: Date
+ publish()
+ delete()

03 - the details

Declaring things

Any capitalised word on its own line becomes a class - that's the default, so you rarely type class at all. Reach for one of these keywords only when you need something more specific:

Keyword

What it means

classDeclare a class - the default, rarely written explicitly
interfaceDeclare an interface (renders with the «interface» stereotype)
abstractDeclare an abstract class
enumDeclare an enum type
noteAdd a free-text sticky note to the canvas

Fields & methods

Once a class exists, give it fields with knows, and behaviour with can. Add a type after a colon, and comma-separate as many as you like on one line.

Account knows accountNumber: String, balance: number
Account can deposit(amount: number), withdraw(amount: number)

Prefix any field or method with a symbol to set its visibility - the same private/protected/public concept from any OOP language:

+

Public

Anyone can see or call it - the default.

-

Private

Only this class can see it.

#

Protected

This class and anything that extends it.

~

Package

Only classes in the same module/area.

04 - the important part

Relationships

This is the one place UML jargon actually matters, so here's each verb translated into plain English - what it means, not just what it's called.

is a- Inheritance

A stronger, more specific version of the parent. A Dog is a kind of Animal - it gets everything Animal has, plus its own stuff.

Dog is a Animal
acts as- Realization

Promises to follow a contract. A Dog acts as Trainable - it must implement whatever Trainable requires, without inheriting behaviour from it.

Dog acts as Pet, Trainable
owns- Composition

Strong, exclusive ownership - the part can't exist without the whole. Delete the Order and its OrderItems go with it.

Order owns OrderItem
has many- Aggregation (1 → *)

A loose "contains" relationship - the parts can outlive the whole. A User has many Post, but deleting the user needn't delete the posts.

User has many Post
has one- Aggregation (1 → 1)

Same idea as "has many", just capped at one - a single optional attachment.

User has one Profile
has- Aggregation (generic)

A generic "contains" relationship when you don't need to specify the count.

Company has Employee
uses- Dependency

A light, temporary reliance - one class calls another but doesn't hold a lasting reference to it.

Service uses Logger
talks to- Bidirectional association

Two classes both know about and call each other.

Client talks to Server
knows about- Directed association

A one-way reference - A knows about B, but B has no idea A exists.

Teacher knows about Student

05 - see it in context

Full examples

Three complete systems, written start to finish - a good way to see how the pieces combine once there's more than one relationship on the page.

User
User knows id, name: String, email: String
User can login(), getOrders(): Order[]
Order
Order knows id, total: number, status: OrderStatus
Order can place(), cancel()
OrderItem
OrderItem knows productId, quantity: int, price: number
Product
Product knows id, name: String, price: number
Product can isAvailable(): boolean
enum OrderStatus
PENDING, CONFIRMED, SHIPPED, DELIVERED
User has many Order
Order owns OrderItem
Order has many Product

06 - good to know

Tips & tricks

Comments

Start a line with # to write a comment. Great for sections or notes.

# Payment domain
PaymentGateway

Multiple targets

Comma-separate targets after any verb - applies to all of them.

Service uses Logger, Database, Cache

Inline enum values

List enum values after the name, or on the next line.

enum Color RED, GREEN, BLUE

Static & abstract

Prefix with $ for static, or write abstract inside can …

Account can $ getInstance(): Account, abstract withdraw()

Ready to design?

Open the Playground and start writing - the diagram builds itself as you type.

Open Playground