ROSEA -- A Relation Oriented Software Execution Architecture

                                Summary

Rosea is a Tcl package that I presented as a Work in Progress at the 21st
conference in 2014.  The package is now complete and ready for use by a wider
audience.

The problem that rosea solves is to provide a suitable base onto which formal
executable software models may be translated into running programs using Tcl as
the implementation language. The models must conform to the execution semantics
of Executable UML.  Executable UML is a well defined profile of UML which has
precisely defined execution rules.

The concepts behind rosea are derived from those I presented at the 15th
conference in 2008 as the paper, "Relation Oriented Programming with Raloo:
What Happens When ::ral Meets ::oo?".  There is also an analogy to the pycca
program that I described at the 17th conference in 2010 in the paper
"Supporting Embedded Software Development: Doing the Heavy Lifting with
Tcl/Tk".  Pycca serves much the same role as rosea using "C" as an
implementation language instead of Tcl. All of this work is dependent upon the
TclRAL extension which I presented at the 13th conference in 2006 in the paper,
"TclRAL: A Relational Algebra for Tcl".

Viewed from an Executable UML perspective, the rosea solution consists of three
primary parts: (1) a domain specific language which is used to describe the
characteristics of the model and (2) a set of procedures used at run-time to
map the model execution semantics onto Tcl language constructs.  (3) a
generator which translates the model characteristics obtained from the domain
specific language into the data structures and values used by the run-time
execution.

Viewed from a strictly Tcl perspective, rosea is an object system based on
namespace ensembles.  Conventional object orientation built upon namespace
ensembles uses namespace variables to hold the instance data and the ability of
the ensemble mechanism to map subcommands into command prefixes.  In the case
of rosea, class data is held in TclRAL relation variables.  This has the
important consequence of allowing integrity constraints to be defined on and
between classes and TclRAL will enforce the constraints to prevent run-time
errors.  The other significant difference is that there is direct, declarative
support for sequencing computation via state models.  This yields event driven
execution sequencing.  Execution semantics also define the boundaries of when
data integrity is checked yielding a system that either successfully
transitions from a known valid state to another valid state or is rolled back
to its last known valid state.

To get a sense of the domain specific language, the following is taken
from the example model of the paper. The example models an automatic
washing machine and one of the classes in that model is the Washing Machine
class. It is defined as:

class WashingMachine {
    attribute MachineId string -id 1
    attribute CycleType string

    reference R4 WashingCycle -link CycleType

    statemodel {
        state Stopped {} {
            # Tcl code executed when the Stopped state is entered
        }
        transition Stopped - Start -> FillingToWash

        state FillingToWash {} {
            # Tcl code executed when the FillingToWash state is entered
        }
        transition FillingToWash - Full -> Washing

        # Other state and transition definitions
    }
}

In this case the WashingMachine class has two attributes, MachineId and
CycleType.  Further, the CycleType attribute serves as a referential attribute
to the WashingCycle class.  The state model specifies the dynamic behavior of
the class and only a portion is shown above.

Rosea also includes many other features to help in building programs in this
manner.  Tracing event dispatch is provided as well as means of specifying the
class initial instance population.  Procedures to signal events immediately and
in the future are provided to drive the dynamics. Rosea also supports drawing
UML sequence diagrams from collected event trace data.

Rosea is explained by a document that is a literate program containing the
complete design discussion, Tcl source code, test cases and a running example.
Reference documentation in the form of a manual page is also provided.
