Skip to main content

Layering

Description

In addition to the actor containment hierarchies, layering provides another method to hierarchically structure a software system. Layering and actor hierarchies with port to port connections can be mixed on every level of granularity.

  1. an actor class can define a Service Provision Point (SPP) to publish a specific service, defined by a protocol class

  2. an actor class can define a Service Access Point (SAP) if it needs a service, defined by a protocol class

  3. for a given actor hierarchy, a LayerConnection defines which SAP will be satisfied by (connected to) which SPP

Notation

For the graphical and textual notation refer to the following table:

Graphical NotationTextual Notation

ActorClass Mode1 {
Structure {
ActorRef Services: ServiceLayer
ActorRef Application: ApplicationLayer

LayerConnection ref Application satisfied_by Services.timer
LayerConnection ref Application satisfied_by Services.digitalIO
}
}
The layer connections in this model define which services are provided by the ServiceLayer (digitalIO and timer)

ActorClass ServiceLayer {
Interface {
SPP timer: TimerProtocol
SPP digitalIO: DigitalIOProtocol
}
Structure {
ActorRef Timer: TimerService
ActorRef DigIO: DifitalIOService
LayerConnection relay_sap timer satisfied_by Timer.timer
LayerConnection relay_sap digitalIO satisfied_by DigIO.digitalIO
}
}
The implementation of the services (SPPs) can be delegated to sub actors. In this case the actor ServiceLayer relays (delegates) the implementation services digitalIO and timer to sub actors

ActorClass ApplicationLayer {
Structure {
ActorRef function1: A
ActorRef function2: B
ActorRef function3: C
ActorRef function4: D
}
}

ActorClass A {
Structure {
SAP timerSAP: TimerProtocol
}
}

ActorClass B {
Structure {
SAP timerSAP: TimerProtocol
SAP digitalSAP: DigitalIOProtocol
}
}
Every Actor inside the ApplicationLayer that contains an SAP with the same protocol as timer or digitalIO will be connected to the specified SPP