PlantUML 
2014-7, Leo Liang
Draw Write 
actor user 
user -> access ++ : getInfo() 
access -> access : authentication() 
access -> backend ++ : getInfo() 
backend -> dataStore : query() 
return 
return
Why Text Based? 
› Writing is sometimes easy than drawing 
– Keyboard typing is faster than mouse dragging 
– Copy and paste 
– Auto layout on generation 
› Text is manageable than binary 
– Keep UML source inside code (javadoc) or document (slides etc.) 
› Convenient for update afterward 
– Track change by version control system 
› Merge is possible 
– Integrate with other system, e.g. IDE, content management system.
Yet Powerful 
› Support all common UML diagrams 
– Sequence diagram Most Useful 
– Class/object diagram Limitation in big diagram 
– Use case diagram 
– Activity diagram / flow chart 
– Component diagram 
– State diagram
Sequence 
actor user 
boundary access 
participant backend 
database dataStore 
user -> access ++ : getInfo() 
access -> access : authentication() 
note right: HTTP Basic or Digest 
access -> backend ++ : getInfo() 
loop for info categories 
backend -> dataStore : query() 
end 
return 
return
Class 
hide empty fields 
hide empty methods 
class InvocationHistoryAspect <<aspect>> 
class InvocationHistoryRecorder { 
+ start(methodName): InvocationContext 
} 
class InvocationContext { 
+ finished(): void 
} 
interface SamplingPolicy 
class TimeBasedSampling implements SamplingPolicy 
class NumberBasedSampling implements SamplingPolicy 
InvocationHistoryRecorder .> InvocationContext 
InvocationContext ..> InvocationHistory 
InvocationHistoryAspect --> InvocationHistoryRecorder 
InvocationHistoryInterceptor --> InvocationHistoryRecorder 
InvocationHistoryRecorder --> SamplingPolicy
Activity 
start 
if (graphviz installed?) then (yes) 
:process all diagrams; 
else (no) 
:process only 
sequence and activity diagrams; 
endif 
stop
Component 
node "Exposure" { 
PxMessaging -- [Messaging] 
PxLocation -- [Location] 
[Property Access CF] 
[Messaging] -> [Property Access CF] 
[Location] -> [Property Access CF] 
} 
node "Biz Admin" { 
GProvI -- [Provisioning] 
} 
database "MySql" { 
folder "SIG-DB" { 
[Common Entities] 
} 
} 
[Provisioning] --> [Common Entities] 
[Property Access CF] --> [Common Entities]
State 
[*] --> NotShooting 
state NotShooting { 
[*] --> Idle 
Idle --> Configuring : EvConfig 
Configuring --> Idle : EvConfig 
} 
state Configuring { 
[*] --> NewValueSelection 
NewValueSelection --> NewValuePreview : EvNewValue 
NewValuePreview --> NewValueSelection : EvRejected 
NewValuePreview --> NewValueSelection : EvSaved 
state NewValuePreview { 
State1 -> State2 
} 
}
Resources 
› Project home: document, download 
– http://www.plantuml.com/ 
› Online editor 
– http://www.plantuml.com/plantuml/form 
– http://www.planttext.com/planttext 
› Integration 
– Eclipse: http://www.plantuml.com/eclipse.html 
– Jekyll: https://github.com/yjpark/jekyll-plantuml 
– More… http://www.plantuml.com/running.html

PlantUML

  • 1.
  • 2.
    Draw Write actoruser user -> access ++ : getInfo() access -> access : authentication() access -> backend ++ : getInfo() backend -> dataStore : query() return return
  • 3.
    Why Text Based? › Writing is sometimes easy than drawing – Keyboard typing is faster than mouse dragging – Copy and paste – Auto layout on generation › Text is manageable than binary – Keep UML source inside code (javadoc) or document (slides etc.) › Convenient for update afterward – Track change by version control system › Merge is possible – Integrate with other system, e.g. IDE, content management system.
  • 4.
    Yet Powerful ›Support all common UML diagrams – Sequence diagram Most Useful – Class/object diagram Limitation in big diagram – Use case diagram – Activity diagram / flow chart – Component diagram – State diagram
  • 5.
    Sequence actor user boundary access participant backend database dataStore user -> access ++ : getInfo() access -> access : authentication() note right: HTTP Basic or Digest access -> backend ++ : getInfo() loop for info categories backend -> dataStore : query() end return return
  • 6.
    Class hide emptyfields hide empty methods class InvocationHistoryAspect <<aspect>> class InvocationHistoryRecorder { + start(methodName): InvocationContext } class InvocationContext { + finished(): void } interface SamplingPolicy class TimeBasedSampling implements SamplingPolicy class NumberBasedSampling implements SamplingPolicy InvocationHistoryRecorder .> InvocationContext InvocationContext ..> InvocationHistory InvocationHistoryAspect --> InvocationHistoryRecorder InvocationHistoryInterceptor --> InvocationHistoryRecorder InvocationHistoryRecorder --> SamplingPolicy
  • 7.
    Activity start if(graphviz installed?) then (yes) :process all diagrams; else (no) :process only sequence and activity diagrams; endif stop
  • 8.
    Component node "Exposure"{ PxMessaging -- [Messaging] PxLocation -- [Location] [Property Access CF] [Messaging] -> [Property Access CF] [Location] -> [Property Access CF] } node "Biz Admin" { GProvI -- [Provisioning] } database "MySql" { folder "SIG-DB" { [Common Entities] } } [Provisioning] --> [Common Entities] [Property Access CF] --> [Common Entities]
  • 9.
    State [*] -->NotShooting state NotShooting { [*] --> Idle Idle --> Configuring : EvConfig Configuring --> Idle : EvConfig } state Configuring { [*] --> NewValueSelection NewValueSelection --> NewValuePreview : EvNewValue NewValuePreview --> NewValueSelection : EvRejected NewValuePreview --> NewValueSelection : EvSaved state NewValuePreview { State1 -> State2 } }
  • 10.
    Resources › Projecthome: document, download – http://www.plantuml.com/ › Online editor – http://www.plantuml.com/plantuml/form – http://www.planttext.com/planttext › Integration – Eclipse: http://www.plantuml.com/eclipse.html – Jekyll: https://github.com/yjpark/jekyll-plantuml – More… http://www.plantuml.com/running.html