ZenUml Basic Example

XiaoPeng
ZenUML
Published in
2 min readOct 6, 2017

Get started

This example shows basic features and DSL of ZenUml — http://www.zenuml.com. It demonstrated how to implemented a RESTful API.

To install the Chrome extension goto:https://chrome.google.com/webstore/detail/web-sequence/kcpganeflmhffnlofpdmcjklmdpbbmef

Call a method

A.method()

You should always call a method by starting with an Entity (Here is A).() after the method name is optional unless you want to put parameters inside. You can put in parameters, such as Counter.increaseBy(1) .

A.method() { internalMethod() }

Put the implementation of a method inside {} after the method name. The diagram on the left shows with in method() we call internalMethod() . If you want to call a method of another entity, just put B.methodB() inside.

Alt section

A.method() { if (condition) { B.method() }}

With ZenUml, you can wrap logic inside if/else and else if . It is recommended that you don’t put this at the root level, which means you don’t start your pseudocode piece with if(condition) . The tool supports that though.

Loop section

A.method() { foreach(item) { B.method() }}

ZenUml supports 4 looping keywords: for , foreach , forEach and while . Like ‘Alt’, it is recommended that you don’t put this at the root level, which means you don’t start your pseudocode piece with foreach(item) . The tool supports this though.

--

--