12.1 Actors
12.1.1 Description
The actor is the basic structural building block for building systems with ROOM. An actor can be refined
hierarchically and thus can be of arbitrarily large scope. Ports define the interface of an actor. An Actor
can also have a behavior usually defined by a finite state machine.
12.1.2 Motivation
- Actors enable the construction of hierarchical structures by composition and layering
- Actors have their own logical thread of execution
- Actors can be freely deployed
- Actors define potentially reusable blocks
12.1.3 Notation
12.1.4 Details
Actor Classes, Actor References, Ports and Bindings
An ActorClass defines the type (or blueprint) of an actor. Hierarchies are built by ActorClasses that
contain ActorReferences which have another ActorClass as type. The interface of an ActorClass is
always defined by Ports. The ActorClass can also contain Attributes, Operations and a finite state
machine.
External Ports define the external interface of an actor and are defined in the <em>Interface</em>
section of the ActorClass.
Internal Ports define the internal interface of an actor and are defined in the <em>Structure</em>
section of the ActorClass.
Bindings connect Ports inside an ActorClass.
Example:
Table 12.2: Actor Class Example
|
|
|
| Graphical Notation | Textual Notation |
|
|
|
| |
|
|
|
| |
- ActorClass1 contains two ActorReferences (of ActorClass2 and ActorClass3)
- port1 is a External End Port. Since it connects external Actors with the behavior of
the ActorClass, it is defined in the Interface section and the Structure section of the
ActorClass.
- port2 and port3 are Internal End Ports and can only be connected to the ports of contained
ActorReferences. Internal End Ports connect the Behavior of an ActorClass with its contained
ActorReferences.
- port4 is a relay port and connects external Actors to contained ActorReferences. This port
can not be accessed by the behavior of the ActorClass.
- port5 through port9 are Ports of contained ActorReferences. port8 and port9 can
communicate without interference with the containing ActorClass.
- Bindings can connect ports of the ActorClass and its contained ActorReferences.
Attributes
Attributes are part of the Structure of an ActorClass. They can be of a PrimitiveType or a
DataClass.
Example:
Operations
Operations are part of the Behavior of an ActorClass. Arguments and return values can be of a
PrimitiveType or a DataClass. DataClasses can be passed by value (implicit) or by reference (keyword
ref).
Example: