OSDN Git Service

Regular updates
[twpd/master.git] / plantuml.md
1 ---
2 title: PlantUML
3 ---
4
5 ### Format
6
7     @startuml
8     Car : drive()
9     Dog : bark()
10     @enduml
11
12     # plantuml file.uml && open file.png
13
14 ## Classes
15
16  * http://plantuml.sourceforge.net/classes.html
17
18 ### Methods
19
20     Car : drive()
21
22 ### Methods (alt)
23
24     class Car {
25       String make
26       year : Integer
27       void drive()
28
29       -private()
30       #protected()
31       ~package private()
32       +public()
33
34       {static} String id
35       {abstract} void methods()
36     }
37
38 ### Lines
39
40     class Car {
41       These are separated by lines.
42       The next line is a dotted line
43       ..
44       Next is a double-stroke
45       ==
46       Next is a plain line
47       --
48       Next is a strong line
49       __
50       You can make headers with it
51       .. header ..
52     }
53
54 ### Associations
55
56     Car <|-- SmallCar      # extension
57     Car *-- Engine         # composition
58     Cars o-- Car           # aggregation
59     Car <|.. SmallCar      # dotted line (use .. instead of --)
60     Car <|--* Car
61
62     -left->
63     -right->
64
65 ### Relations
66
67     Driver - Car : drives >
68     Car -- Owner : < owns
69     Car *-- Wheel : has 4 >
70
71 ### Notes
72
73     class Car {
74     }
75     note left: Something something
76
77     note top of Car : This is a car.
78
79 ### Namespaces
80
81     namespace Client {
82       class Driver {
83       }
84     }
85
86     Car -- Client.Driver : owns >
87
88
89 ## Activities
90
91     (*) --> "First Activity"
92     -->[You can put also labels] "Second Activity"
93     --> (*)
94