ABSTRACT

State machines cannot operate in a vacuum. Apart from the event processor (supplied by the behavioral inheritance meta-pattern), the execution environment for a state machine must provide, at a minimum, the execution context (thread) and the event queuing, event dispatching, and timing services. These elements strongly depend on application domain and operating system support. However, within a given domain, they change little from system to system, and their sufficiently robust representations can be reused in many applications, rather than being developed from scratch each time. For example, you could reuse an event queue or a timeout event generator across many projects. However, you can do even better than merely reuse specific elements as building blocks — you can reuse the whole infrastructure surrounding state machines.