Finite State Machines

Today’s reading material is about another ancient framework for software development — the finite state machine — but with a contemporary twist.

The finite state machine is one conceptual framework for breaking down a system or subsystem into modular, easily-testable, easily-maintainable pieces.  It essentially consists of a graph of states and transitions.  The machine is always in exactly one state, but inputs can cause it to transition to new states.

http://www.itl.nist.gov/div897/sqg/dads/HTML/finiteStateMachine.html

There are a number of ways of depicting finite state machines visually, but they typically involve a lot of bubbles and arrows, as in:

Finite State Machine (Magic Flute MIDI controller)

Edward J. Pring writes about using finite state machines to develop cutesy fading “tooltips” in JavaScript.  The demo:

http://www.ibm.com/developerworks/library/wa-finitemach1/test_files/FadingTooltipTests.html

Although the end result is a bit glitzy for my tastes, the thought process that went into creating it is so common-sense it’s uncommonly brilliant.

http://www.ibm.com/developerworks/library/wa-finitemach1/

http://www.ibm.com/developerworks/web/library/wa-finitemach2/index.html

JavaScript has its flaws, but this article helped convince me that there is a little kernel of elegance to the language.  The article might not convince you, but it may just give you some ideas on how to design your next GUI.

Happy reading!

Advertisements

One Response to “Finite State Machines”

  1. camiloazula Says:

    Simple JavaScript FSM http://camiloazula.wordpress.com/2010/10/14/fms/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: