Chapter 36. State


© Jennifer M. Kohnke

A state without the means of some change is without the means of its conservation.

Edmund Burke (17291797)

Finite state automata are among the most useful abstractions in the software arsenal and are almost universally applicable. They provide a simple and elegant way to explore and define the behavior of a complex system. They also provide a powerful implementation strategy that is easy to understand and easy to modify. I use them in all levels of a system, from controlling the high-level GUI to the lowest-level communication protocols.

We studied the notation and basic operation of FSMs in Chapter 15. Now let's look at the patterns for implementing them. Consider the subway turnstile in Figure 36-1 once again.

Figure 36-1. Turnstile FSM that covers abnormal events





Agile Principles, Patterns, and Practices in C#
Agile Principles, Patterns, and Practices in C#
ISBN: 0131857258
EAN: 2147483647
Year: 2006
Pages: 272

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net