PlantUML Flashcards
how to start and end a class/sequence diagram
@start
@end
A
with A A – B appears above
–>so it seems that LHS is above RHS
–|> means….
and
..|> means…
we are using –|> to mean extends, i.e. subclass: A extends B (dotted line, closed arrow head)
vs
..|> means implements, i.e. interface (solid line, closed arrow head)
*–
composite A *– B
–>B is an attribute of A
A “has-a” B as a field/attribute
*– : solid line, closed diamond
o–
aggregation A o– B
–>? not sure…maybe “is-a”, or dependent class?
o– : solid line, open diamond
package
package "Classic Collections" #DDDDDD { Object gives nice card-looking outline of anything in {} #DDDDDD light grey
class "This is a class" as class1 {blabla} or class class2 as "It works this way too" {blabla}
The diagram will have what is in quotes as the displayed text. The -as- classname can be used when giving the relationships
class "This is a class" as class1 {blabla} or class class2 as "It works this way too" {blabla}
The diagram will have what is in quotes as the displayed text. The -as- classname can be used when giving the relationships
More useful for packages or components:
component “Book Genre” as genre {….}
specific “spot”
spot is the term for the circulur icon -- class classname <> spotname (optional, appears in between <>) 1. class System << (S,#FF7700) Singleton >> 2. class Date << (D,orchid) >>
scale 750 width
hm…can set the size of the diagram?
put at top, under @startuml
packages style
makes the package appear graphically
example: package foo1 <> {}
<> (a box) <> <> <> <> <>
can also set all packages:
skinparam packagestyle <>
default arrow orientation
By default, links between classes have two dashes – and are vertically oriented. It is possible to use horizontal link by putting a single dash (or dot) like this:
Room o- Student
title
appears at top
create styled relationship lines
@startuml title Bracketed line style with label class foo class bar bar1 : [bold] bar2 : [dashed] bar3 : [dotted] bar4 : [hidden] bar5 : [plain]
foo --> bar : ∅ foo -[bold]-> bar1 : [bold] foo -[dashed]-> bar2 : [dashed] foo -[dotted]-> bar3 : [dotted] foo -[hidden]-> bar4 : [hidden] foo -[plain]-> bar5 : [plain] @enduml
together
can be used alone or with package, component