3.5 Layering

3.5.1 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 (SPPRef) to publish a specific service, defined by a protocol class
  2. an actor class can define a Service Access Point (SAPRef) 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

3.5.2 Notation

For the graphical and textual notation refer to table 3.5


Table 3.5: Layering Notation



Description

Graphical Notation

Textual Notation




The layer connections in this model define which services are provided by the ServiceLayer (digitalIO and timer)

PIC
ActorClass Mode1 { 
 Structure { 
   ActorRef Services: ServiceLayer 
   ActorRef Application: ApplicationLayer 
   LayerConnection ref Application satisfied_by Services.timer 
   LayerConnection ref Application satisfied_by Services.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

PIC
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 
 } 
}




Every Actor inside the ApplicationLayer that contains an SAP with the same protocol as timer or digitalIO will be connected to the specified SPP

PIC
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 
 } 
}