Pidgin syntax is very simple. There are two basic ways of relating the entities (things/boxes) in your diagrams. They are generally not used at the same time but you can mix and match the two types in a single diagram too if you want to.
Object
is not the same as object
. (NB: I am probably going to change this soon.)
Entity
), concatenated words (
MyEntity
or
my_entity
). You can also use speech marks if you want to use multiple words or punctuation marks, e.g.
"My Entity"
, and "IsTrue?"
which can be handy in flowcharts.
.
objects
is different to
object
).#
as the first character on the line. You can also add comments to the diagram itself by using the comment
verb specifying first the relationship entity or flowchart step you're commenting, like this: Object comment "Some comment"
. You can use \n
to make the comment break onto a new line if it's long.
Relationships are described with:
ThingOne relationship ThingTwo
, or
ThingOne relationship cardinality ThingTwo
"Cardinality" just means how many, so you can optionally say things like this. E.g.
User has a Car
Car has many Wheel
Car has one SteeringWheel
Wheel has optional FancyHub
There are 11 main relationship verbs and each has their own style of arrow which can have a different tail, head and colour:
Verb | Tail | Head | Colour |
---|---|---|---|
is | no decorator | arrow (solid) | red |
sees | no decorator | arrow (solid) | green |
extends | no decorator | arrow (solid) | green |
updates | no decorator | arrow (solid) | blue |
from | arrow (solid) | no decorator | red |
has | no decorator | black | |
uses | diamond (outline) | arrow (solid) | blue |
controls | diamond (outline) | arrow (solid) | red |
contains | diamond (solid) | arrow (solid) | blue |
inherits | arrow (solid) | no decorator | red |
association | no decorator | no decorator |
There are 4 main cardinalities which change the style of the relationship arrow(s):
Cardinality | Tail | Head |
---|---|---|
many | crow's foot | |
optional | circle (outline) | |
one | T shape | |
a | T shape |
Flowcharts can be described very simply and quickly:
StepOne then StepTwo
, or
StepOne then Decision
(Nb: pidgin doesn't really distinguisgh between decisions and steps; a decision is just another type of step).
You can specify any condition following a decision like this:
Decision [optional condition] then StepWhatever
There are 2 words that pidgin considers to be flow actions:
Word | Tail | Head | Colour |
---|---|---|---|
then | no decorator | arrow (solid) | blue |
next | no decorator | arrow (solid) | blue |