In a different thread, Rocco wrote:

POE::NFA is not well documented.  It seems to be the strange cousin of
POE::Session that people rarely talk about, so time is focused
elsewhere.

That's certainly true, but it's puzzling to me. POE::NFA is extremely powerful! It's like POE::Session's big brother, rather than its strange cousin. I don't know why more people aren't using it. A Session has events, but an NFA has events and states! An event can be handled differently depending on what state the NFA is in when the event arrives. Totally cool.

POE::Session is great for stateless applications, but it's been my experience that most applications of any complexity do have states, even if we don't always think of them that way. POE::NFA enables an application to be explicit about what state it's currently in, and to use event handlers specifically "tuned" for that state. And that, in turn, enables me as an application writer to explicitly divide a complex application into conceptual "chunks", where each chunk consists of the event handlers for just one state. It's a powerful mental tool as well as a powerful programming tool. I think of POE::NFA as a superset of POE::Session. I'd hate to see it neglected!

Tim Klein
Dallas, Texas

Reply via email to