The start and end of an expression are shown with vertical bars. The expression is read from left to right following a path defined by the line(s). |  | Diagram( Terminal('This '), Terminal(' is '), Terminal(' a '), Terminal(' mp3monster '), Terminal(' blog ') ) |
| Larger diagrams may need to be read both across and down the page to make it sensibly fit a page like this. |  | Diagram( Stack( Terminal('This '), Terminal(' is '), Terminal(' a '), Terminal(' mp3monster '), Terminal(' blog ')) ) |
We can differentiate between literal values and ‘variables’ by shape. A square shape should denote a variable, and a lozenge represents a literal. I have to admit to sometimes getting these the wrong way around, but as long as the notation is used consistently in an expression, it isn’t too critical. In this example, we have replaced mp3monster with the name of a variable called domain-name. So if I set the variable domain-name = mp3monster then I’d read the same result. |  | Diagram( Stack( Terminal('This '), Terminal(' is '), Terminal(' a '), NonTerminal(' domain-name'), Terminal(' blog ')) ) |
We can make parts of an expression optional. This can be seen by following an alternate path around the optional element. In this case, we’ve made the domain-name optional. Assuming domain-name = mp3monster, we could get either: – This is a mp3monster blog OR – This is a blog |  | Diagram( Stack( Terminal('This '), Terminal(' is '), Terminal(' a '), Optional(
NonTerminal(' domain-name')), Terminal(' blog ')) ) |
We can represent optionality by having the flow split to multiple values. Those values could be either literal values or variables. In this case, we now have several possible names in the blog with the choices being mp3monster, phil-wilkins, cloud-native, or the contents of the variable domain-name. So the expression here could resolve to (assuming domain-name = something-else): – This is a mp3monster blog OR – This is a phil-wilkins blog OR – This is a cloud-native blog OR – This is a something-else blog It is typical for the option most likely to be selected to be the value that is directly in line with the choice. Here that would mean the default would be phil-wilkins |  | Diagram( Stack( Terminal('This '), Terminal(' is '), Terminal(' a '), Choice(1,
' mp3monster',
' phil-wilkins ',
' cloud-native ',
NonTerminal('domain-name')), Terminal(' blog ')) ) |
| We can have variations on a choice where we can express the choice as being any of the options (one or more e.g. mp3monster and cloud-native) or all of the choices. These scenarios are differentiated by the additional symbols before and after the choice. |   |
Diagram( Stack( Terminal('This '), Terminal(' is '), Terminal(' a '), MultipleChoice(1,
'any',' mp3monster',
' phil-wilkins ',
' cloud-native ',
NonTerminal('domain-name')), Terminal(' blog ')) ) |
We can represent the looping with the inclusion of an additional literal(s) or variable(s) by having a second line from the right (exit) of a literal or variable and flowing back into the left (entry) of a literal or variable. Then in the loop of the flow below are the variable(s) or literal(s) that go around between each occurrence of the loop. If our variable was a list now i.e. domain-name = [‘ mp3monster’, ‘cloud-native’] then this would resolve to : This is a mp3monster and cloud-native blog |  | Diagram( Stack( Terminal('This '), Terminal(' is '), Terminal(' a '), OneOrMore(
NonTerminal('domain-name'),
[' and '])), Terminal(' blog ') ) |
| We can group literals and variables together with a label. These groupings are denoted with a dashed line and usually include some sort of label. In our example, we’ve grouped two literal values together and called that group the blog name. |  | Diagram( Stack( Terminal('This '), Terminal(' is '), Terminal(' a '),), Group(Sequence(
Terminal(' mp3monster '), Terminal(' blog ')),
['blog name']) ) |
| | |
| | |
You must be logged in to post a comment.