The Composition viewpoint describes the way the architecture subject is recursively structured into constituent parts (packages and classes in the object-oriented viewpoint) and establishes the roles of those parts.
Concerns
allocation of functionality and responsibilities
the major constituents of the architecture subject
mechanisms for extension and reuse
Model Kind
The UML class diagram shown in Figure SAS-COMP (static view) depicts core classes comprising QP Framework and their relation to classes in the QP Application shown at the bottom of Figure SAS-COMP.
Remarks
Because the class diagram in Figure SAS-COMP is drawn in a traditional way (with base classes on top and derived classes below), the layering in this class diagram is reversed compared to the package diagram in Figure SAS-CTXT.
Figure SAS-COMP: Core classes in QP Framework and their relation to QP Application.
Views
The following traceable architectural views explain the main QP Framework sub-packages and classes, their responsibilities, and relationships:
SAS_QP_COMP_SLR
SAS_QP_COMP_SLR : QP Framework Sub-layers
Description
The QP Framework internally is further decomposed into the following sub-layers:
QEP Event Processor is intentionally separated out to allow QP Applications to directly use just the passive state machines (without Active Objects). QP Applications that use just the QEP Event Processor can still benefit from the QM modeling tool↑, which can generate code that requires only passive state machines.
SAS-COMP [11] The QEvt class represents events in QP Framework. It can be instantiated directly (concrete class), in which case it represents events without parameters. QP Applications can also inherit and extend QEvt to add custom event parameters. Examples of events with parameters are provided as QP Application classes EventA and EventB (SAS-COMP [01]).
SAS-COMP [12] The QAsm class is the abstract base class (ABC) for all state machines in QP Framework. The QAsm class specifies the abstract state machine interface.
SAS-COMP [23] The abstract QActive class is a base class for derivation of concrete Active Objects in the QP Application. QActive encapsulates the unique priority, event-queue, execution context, and state machine for the Active Object. QActive inherits QAsm, which means that an Active Object in QP can be treated as a state machine with the standard interface. QActive implements this interface by delegating to the QHsm state machine implementation.
SAS-COMP [24] The abstract QMActive class derives from QActive base class, so it inherits all its properties. The only difference is that, QMActive implements the state machine interface by delegating to the QMsm state machine implementation.
SAS-COMP [21] The QTimeEvt class derived from QEvt represents Time Events in QP (sometimes called timers). QTimeEvt can be instantiated directly (concrete class). Upon instantiation QTimeEvt gets associated with a given event signal, clock tick rate, and Active Object instance (owner). A QTimeEvt can be then armed to time out only once (one-shot) or periodically. Several QTimeEvt can time out simultaneously in parallel.
Backward Traceability
SRS_QP_EVT_00: QP Framework shall provide Event abstraction to QP Application
SRS_QP_SM_00: QP Framework shall provide support for hierarchical state machines both for Active Objects and for passive event-driven objects in the Application
SRS_QP_AO_00: QP Framework shall provide the Active Object abstraction to QP Application
SRS_QP_TM_00: QP Framework shall support Time Events.