Pauware presentation
PauWare is a tool enabling to execute UML state machines in plain Java programs. It is composed of two elements:
- An API defining a set of classes for building/programming a UML state machine associated
with business operations
- An execution engine that carries on events and executes the business operations
Pauware can be used with any Java platform. There exists a version for Java ME and Java EE, both compatible with Java SE, as well as a boilerplate code for Android or the NAO robot. Even if there exists a Pauware plugin for Netbeans, programing with the Pauware API can be done with any Java IDE as it requires only to import a JAR file. This file has a size of only 100 kB. This document makes a quick presentation of Pauware and shows its main features through concrete examples.
Guidelines
Programming with Pauware requires to think your code in a different way as the application execution will be event-driven. It is thus well-suited for reactive programming. The ultimate goal of an application is to execute business operations. The behavior of the application consists in defining when and why calling such business operations at a given point in time during the execution of the application. With Pauware, all this behavior is defined through a state machine and business operations are associated with states and transitions. To make the application evolving, i.e. executing it, there is a single thing to do: asking the state machine to process an event. This is simply done in this way: stateMachine.run_to_completion("myEventName"); If, starting from the current active states, there exists transitions associated with this event, then the Pauware engine triggers the transitions and executes the business operations associated with the transitions and the target states. This way of programming has some consequences:
- In your code, you never directly call business operations: they will be called by the Pauware
execution engine.
- It is not possible to get the returned value of a business operation. You have to modify the
content of a shared object to get the result of the operation.
- If your business operations are taking parameters, there is a special (and not very intuitive)
way to specify them when calling business operations. 1