How to write state machines with c#?

Nestor picture Nestor · Oct 4, 2009 · Viewed 18.7k times · Source

I need to write state machines that run fast in c#. I like the Windows Workflow Foundation library, but it's too slow and over crowded with features (i.e. heavy). I need something faster, ideally with a graphical utility to design the diagrams, and then spit out c# code. Any suggestions? Thanks!

Answer

bobbymcr picture bobbymcr · Oct 4, 2009

Ultimately, you probably want the newly redesigned WF engine in .NET 4.0, as it is much faster and provides a flowchart activity (not quite a state machine, but works for most scenarios) and a nice designer UI experience. But since it's not yet released, that is probably not a good answer for now.

As an alternative, you could try stateless, a library specifically for creating state machine programs in .NET. It doesn't appear to provide a UI, but looks well-suited to fulfill your other goals.