Content deleted Content added
wiki reference added |
Elaborated on basic concepts and some details of ROOM |
||
Line 7:
ROOM was supported by [[ObjecTime Developer]] (commercial) and is now implemented by the official [[List of Eclipse projects|Eclipse project]] eTrice<ref>[http://www.eclipse.org/etrice eTrice - ROOM Open Source Tool]</ref>
When [[
== Concepts and Key Notions of ROOM ==
ROOM is a modeling language for the definition of software systems. It allows the complete [[code generation]] for the whole system from the model. ROOM comes with a textual as well as with a graphical notation.
Typically the generated code is accompanied with manually written code, e.g. for graphical user interfaces ([[GUI]]).
The code is compiled and linked against a runtime library which provides base classes and basic services (e.g. messaging).
ROOM describes a software system along three dimensions: structure, behavior and inheritance. The following sections will explain these three aspects in more detail.
=== Structure ===
The structural view in ROOM is composed of ''actors'' or ''capsules''. Actors can communicate with each other using ''ports''. Those ports are connected by ''bindings''. Actors do [[message passing|exchange messages]] [[asynchronous communication|asynchronously]] via ports and bindings.
To each port a unique ''protocol'' is assigned. A protocol in ROOM defines a set of outgoing and a set of incoming messages.
Ports can be connected with a binding if they belong to the same protocol and are conjugate to each other. That means that one port is sending the outgoing messages of the protocol and receiving the incoming ones. This port is called the ''regular'' port.
Its peer port, the ''conjugated'' port, receives the outgoing messages and sends the incoming ones of the protocol.
In other words, a port is the combination of a ''required'' and a ''provided interface'' in a ''role'' (since one and the same protocol can used by several ports an actor).
[[File:Structure of AnActorClass.jpg|thumb|Example of a structure diagram]]
An actor can contain other actors (as a [[object composition|composition]]). In ROOM these are called ''actor references'' of ''actor refs'' for short.
This allows to create structural hierarchies of arbitrary depth.
The actor's ports can be part of its interface (visible from the exterior) or part of its structure (used by itself) or both.
Ports that are part of the interface only are called ''relay ports''.
They are directly connected to a port of a sub actor (they are delegating to the sub actor).
Ports that are part of the structure only are called ''internal end ports''.
Ports that belong to both, structure and interface, are called ''external end ports''.
=== Behavior ===
Each actor in ROOM has a behavior which is defined by means of a hierarchical [[finite-state machine]], or just state machine for short.
A state machine is a [[directed graph]] consisting of nodes called ''states'' and edges called ''transitions''.
State transitions are triggered by incoming messages from an internal or external end port.
In this context the messages sometimes are also called ''events'' or ''signals''.
If a transition specifies a certain ''trigger'' then it is said to ''fire'' if the state machine is in the source state of the transition and a message of the type specified by the trigger arrives. Afterwards the state is changed to the target state of the transition.
[[File:ROOM Behavior Diagram.jpg|thumb|ROOM behavior diagramm (state machine)]]
During the state change certain pieces of code are executed. The programmer (or modeler) can attach them to the states and transitions.
In ROOM this code is written in the so called ''detail level language'', usually the target language of the code generation.
A state can have ''entry code'' and ''exit code''. During a state change first the entry code of the source state is executed.
Then the ''action code'' of the firing transition is executed and finally the entry code of the target state.
A typical part of those codes is the sending of messages through ports of the actor.
=== Inheritance ===
As other [[object-oriented programming|object oriented programming languages]] ROOM has the concept of [[class (computer programming)|classes]].
Actors are classes which can be instantiated as [[object-oriented programming|objects]] several times in the system.
Of course each instance of an actor class is in its own state and can communicate with other instances of the same (and other) classes.
Similar to other modern programming languages ROOM allows [[inheritance (object-oriented programming)|inheritance]] of actor classes.
It is a single inheritance as an actor class can be derived from another actor class (its ''base class'').
It inherits all features of the base class like ports and actor refs, but also the state machine.
The derived actor class can add further states and transitions to the inherited one.
== Literature ==
|