Provides an extended plantuml preprocessing functionality to adopt diagrams for different platforms.
This framework overrides standart plantuml syntax. Instead of using arrow syntax to send message from one instance to other, it is required to use accessor to according responsibility levevel. There are the following responcibility levels:
- $App()
- $User()
- $Screen()
- $Logic()
Defines the interaction of an application with the system. Currently it can handle the following messages:
- $App(launch) - the main entry point into application.
- $App(show
Screen
) - show specified screen as the root screen of application. - $App(finish
Screen
) - finish specified screen.
Missing functionality:
- Handle background and foreground app states
- Handle remote notifications
Defines an interaction with an application. Currently it can handle the following messages:
- $User(finish App)
Defines the functionality of App
or User
interaction with the screen. Currently it can handle the following messages:
- $Screen(
name
, tap onaction
element
) - definesaction
handler whenUser
taps anelement
on the screen withname
- $Screen(
name
, showchild
) - showchild
screen from screen withname
- $Screen(
name
, end tap) - end last tap action handling on the screen withname
- $Screen(
name
, finishchild
) - finishchild
screen and return to screen withname
Defines the functionality of App
or Screen
interaction with business logic of the application. Currently it can handle the following messages:
- $Logic(
instance
,action
) - initiates interaction ofinstance
with business logic to performaction
. Instance can beApp
orScreen
. - $Logic(
instance
, failaction
) - returns negative result ofaction
toinstance
. - $Logic(
instance
, successaction
) - returns positive result ofaction
toinstance
. - $Logic(
instance
, endaction
) - end performingaction
.
Add app.uml
file and scpecify $CONFIG
variable:
@startuml
!$CONFIG = {
"app": {
"color": "#<color>"
},
"screen": {
"color": "#<color>"
},
"screens": [
...
{"name": "<name>", "color": "#<color>"},
...
]
}
@enduml
Here "app" customize appearance of App
responcibility level, "screen" - default appearance of any screen, "screens" - appearence and order of concrete screen with name
.
Make sure you have installed plantuml.
Then just put rsb
folder of this repo in the same folder with your diagram and include main
file:
!include rsb/main.uml
@startuml
!include rsb/main.uml
== Launch ==
$App(launch)
$App(show Library)
== Subscription ==
$Screen(Library, tap on Subscription Button)
$Screen(Library, show Subscription)
$Screen(Library, end tap)
$Screen(Subscription, tap on Purchase Button)
$Logic(Subscription, purchase subscription)
$Screen(Subscription, end tap)
$Logic(Subscription, fail purchase subscription)
$Screen(Subscription, show Error)
$Screen(Subscription, finish Error)
$Logic(Subscription, success purchase subscription)
$Logic(Subscription, end purchase subscription)
$Screen(Library, finish Subscription)
== Finish ==
$App(finish Library)
$User(finish App)
@enduml
Platform iOS is already supported. To render the diagram in iOS format run pluntuml
with variable MODE
set to ios
:
plantuml my.uml -DMODE=ios
Currently supported following iOS app architecture specifications:
- $set_has_coordinator(
module
,value
) - defines shouldmodule
has its own coordinator.value
can be%true()
or%false()
- $set_has_factory(
module
,value
) - defines shouldmodule
has a factory to display collection items. - $set_service_capability(
service
,action
) - defines which service should handleaction
.
You should provide ios/app.uml
file with according specifications.
`ios/app.uml
@startuml
$set_has_coordinator(Library, %true())
$set_has_factory(Library, %true())
$set_service_capability(SubscriptionService, purchase subscription)
@enduml
Platform Android
support is still missing. To support platform it is required to create overrides for the following methods:
!procedure $configure_participants
- instantiate default participants.!procedure $launchApp
- customize main entry point of application.!procedure $show($instance, $arguments_map)
- customize screen presentation from$instance
.$arguments_map
is the string in format...,key:value,...
that contains presenting screen specifications. To retrieve value by key from$arguments_map
you can use$mapped_value($arguments_map, key)
.!procedure $tap($screen, $arguments_map)
- handle user interaction with view element and perform according logic.!procedure $end_tap($screen, $arguments_map)
- deactivate participants that handle tap.!procedure $end_screen($screen, $arguments_map)
- decativate participans that handle View - Controller logic on the screen.!procedure $call_logic($screen, $message)
- handle message sending to business logic.!procedure $success_logic($screen, $message)
- handle success result of business logic.!procedure $fail_logic($screen, $message)
- handle failed ressult of business logic.!procedure $end_logic($screen, $message)
- deactivate participants of business logic that handles$message
.!procedure $finish($instance, $arguments_map)
- finish child and return to$instance
.
See ios.uml
as example
- Nikolay Tyunin, nikolay.tyunin@rosberry.com
This project is owned and maintained by Rosberry. We build mobile apps for users worldwide 🌏.
Check out our open source projects, read our blog or give us a high-five on 🐦 @rosberryapps.
The project is available under the MIT license. See the LICENSE file for more info.