Real-Time Object-Oriented Modeling
   HOME

TheInfoList



OR:

Real-Time Object-Oriented Modeling (ROOM) is a
domain-specific language A domain-specific language (DSL) is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains. There are a wide variety of DSLs, ranging ...
. ROOM was developed in the early 1990s for modeling
Real-time system Real-time computing (RTC) is the computer science term for hardware and software systems subject to a "real-time constraint", for example from event to system response. Real-time programs must guarantee response within specified time constrai ...
s.Summary of the book "Real-Time Object-Oriented Modeling"
/ref> The initial focus was on
telecommunication Telecommunication is the transmission of information by various types of technologies over wire, radio, optical, or other electromagnetic systems. It has its origin in the desire of humans for communication over a distance greater than that ...
s, even though ROOM can be applied to any event-driven real-time system. ROOM was supported by
ObjecTime Developer ObjecTime Developer (or ObjecTime or OTD, for short) is a software automation tool designed to meet the development needs of real-time software development teams. The tool was created by ObjecTime Limited of Kanata, Ontario, and was aimed at aiding ...
(commercial) and is now implemented by the official Eclipse project
eTrice eTrice is a CASE-Tool for the development of real-time software. It is an official Eclipse project. The software architecture tooling eTrice is implementing the domain specific language Real-Time Object-Oriented Modeling ROOM. It provides c ...
When UML2 was defined (version 2 of
UML The Unified Modeling Language (UML) is a general-purpose, developmental modeling language in the field of software engineering that is intended to provide a standard way to visualize the design of a system. The creation of UML was originally m ...
with real time extensions), many elements of ROOM were adopted.


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 GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
). 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 exchange messages 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 be used by several ports of an actor). An actor can contain other actors (as a
composition Composition or Compositions may refer to: Arts and literature *Composition (dance), practice and teaching of choreography *Composition (language), in literature and rhetoric, producing a work in spoken tradition and written discourse, to include v ...
). In ROOM these are called ''actor references'' or ''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 A finite-state machine (FSM) or finite-state automaton (FSA, plural: ''automata''), finite automaton, or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number o ...
, or just state machine for short. A state machine is a
directed graph In mathematics, and more specifically in graph theory, a directed graph (or digraph) is a graph that is made up of a set of vertices connected by directed edges, often called arcs. Definition In formal terms, a directed graph is an ordered pa ...
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. 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 exit 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. State machines in ROOM also have a graphical notation similar to the UML state charts. An example is shown in the diagram in this section. A state machine can also have a hierarchy in the sense that states can have sub state machines. Similar to the structure this can be extended to arbitrary depth. For details of the semantics of hierarchical state machines we refer to the original book.Bran Selic, Garth Gullekson, Paul T. Ward: "Real-Time Object-Oriented Modeling", New York, John Wiley & Sons Inc, 1994, An important concept in the context of state machines is the execution model of ''run-to-completion''. That means that an actor is processing a message completely before it accepts the next message. Since the run-to-completion semantics is guaranteed by the execution environment, the programmer/modeler doesn't have to deal with classical thread synchronization. And this despite the fact that typical ROOM systems are highly concurrent because of the asynchronous communication. And maybe its worth to stress that the asynchronous nature of ROOM systems is not by accident but reflects the inherent asynchronicity of e.g. the machine being controlled by the software. Definitely this requires another mind set than the one that is needed for functional programming of synchronous systems. But after a short while of getting accustomed it will be evident that asynchronously communicating state machines are perfectly suited for control software.


Inheritance

Like other object oriented programming languages ROOM uses the concept of classes. Actors are classes which can be instantiated as
objects Object may refer to: General meanings * Object (philosophy), a thing, being, or concept ** Object (abstract), an object which does not exist at any particular time or place ** Physical object, an identifiable collection of matter * Goal, an ai ...
several times in the system. Of course each instance of an actor class tracks its own state and can communicate with other instances of the same (and other) classes. Similar to other modern programming languages ROOM allows
inheritance Inheritance is the practice of receiving private property, titles, debts, entitlements, privileges, rights, and obligations upon the death of an individual. The rules of inheritance differ among societies and have changed over time. Of ...
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.


Layering

A last powerful concept of ROOM is ''layering''. This notion refers to the vertical layers of a software system consisting of services and their clients. ROOM introduces the notions of ''service access point (SAP)'' for the client side and ''service provision point (SPP)'' for the server side. From the point of view of an actor implementation the SAPs and SPPs work like ports. Like ports they are associated with a protocol. But other than ports they don't have to (and even cannot) be bound explicitly. Rather, an actor is bound to a concrete service by a ''layer connection'' and this binding of a service is propagated recursively to all sub actors of this actor. This concept is very similar to dependency injection.


Literature

* Bran Selic, Garth Gullekson, Paul T. Ward: "Real-Time Object-Oriented Modeling", New York, John Wiley & Sons Inc, 1994,


References


External links

*{{Commonscatinline Real-time technology Architecture description language Data modeling languages Data modeling diagrams Software modeling language