shanz wrote:
How about Triggered Operations?
[...]
Who uses triggered ops and when and why?
[...]
One possible use case for triggered operation are synchronous service calls to lower layers in layered applications, where a statemachine can/will be used to perform a state based access control to (private) primitive operations via its (public) triggered operations.
Instead of having a logical check at the entry point of each single service operation in the lower layer (e.g. is it allowed to call that operation right now, or not?), such service operations could be made private (not accessible from outside) and corresponding triggered operations would then delegate the external (triggered operation) calls to the internal operations, if (and only if) it is allowed in the current state.
Many services do have such a state based behavior. Explicitly capturing the behavior and filtering the access to services is a much more visible and better understandable way of implementation vs. a "distributed state machine", where the state based access control code is literally distributed among many operations.
Secondly, triggered operations are typically used in top down service calls within layered applications, while asynchronous calls (decoupling realtime dependencies from driver level to apllication level) are typically done in bottom up answers.
It is not common, to mix asynchronous event receptions with synchronous triggered operations within the same statemachine.
Communication between objects on the same layer within an application is typicall done asynchronously based on event receptions.
-Luke.