ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
[boost] Re: [prereview request][fsm]
by Andreas Huber other posts by this author
May 27 2004 4:51PM messages near this date
[boost] Re: Re: [prereview request][fsm] | Re: [boost] Re: [prereview request][fsm]
E. Gladyshev <egladysh <at>  yahoo.com> writes:

>  > boost::fsm does exactly this and in a generic fashion.
>  
>  Does it mean that the state machine framework allows 
>  me to specify what event it will generate
>  for a particular exception type?

Yes, you can do that if you want (it is a per state machine policy). The 
default is to always dispatch an exception_thrown event.

>  If so does it mean that all unspecified exceptions
>  won't be caught by the framework?

Yes, you can do that. The default is to catch all exceptions.

>  > This is the traditional way of dealing with failures in state machines. It 
>  > works, but it is cumbersome.
>  
>  Why is it cumbersome?

Because you have to write lots boiler-plate code yourself (catch the exception 
and post the error event in a lot of actions). The framework can automate this 
for you.

>  > Why not let the exception slip out of the action and let the state machine 
>  > framework:
>  > 1. catch the exception
>  > 2. generate an appropriate event
>  > 3. dispatch that event to the appropriate state (see docs for details)
>  > 4. check that the event has indeed been processed and that the machine is 
back 
>  > in a stable state
>  > 
>  
>  If the framework knows all possible exception types
>  and appropriate events associated with them, then
>  this should work just fine.

It doesn't typically have to. I think the default behavior is ok for most 
projects. See http://tinyurl.com/2uzs5, Discriminating exceptions.

>  The only problem I have is #4.
>  If all exceptions are expected, why do you need
>  any special checks that the event has indeed 
>  been processed. In this case, any exception
>  is just a normal event (just like any other event)
>  and the state machine is never in an unstable state.
>  What do you mean exactly by stable/unstable state?

See http://tinyurl.com/2bjjw, Unstable state machine

>  It sounds kind of disturbing to me when
>  a generic state machine framework defines
>  some sort of unstable states on its own.

I don't think so, the behavior is clearly defined and just automates what 
you'd do manually anyway.

Regards,

Andreas

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Andreas Huber
Andreas Huber
Andreas Huber
Darryl Green
Darryl Green
Darryl Green
Darryl Green
Andreas Huber
E. Gladyshev
Andreas Huber
Andreas Huber
E. Gladyshev
E. Gladyshev
Darryl Green
Andreas Huber
Johan Nilsson
Darryl Green
Andreas Huber
Andreas Huber
Rob Stewart
Andreas Huber
Rob Stewart
Johan Nilsson
Andreas Huber
Andreas Huber
Johan Nilsson
Johan Nilsson
Andreas Huber
Andreas Huber
Andreas Huber
Darryl Green
David Abrahams
Andreas Huber
Andreas Huber
Rob Stewart
Andreas Huber
Andreas Huber
Andreas Huber
Andreas Huber
David Abrahams
David Abrahams
David Abrahams
Andreas Huber
Andreas Huber
Darryl Green
David Bergman
David Abrahams
David Abrahams
David Abrahams
Andreas Huber
Andreas Huber
David Abrahams
Andreas Huber
Andreas Huber
Andreas Huber
Andreas Huber
Darryl Green
Andreas Huber
Robert Bell
David Abrahams
E. Gladyshev
Johan Nilsson
Jeff Flinn
Johan Nilsson
Andreas Huber
Jeff Flinn
E. Gladyshev
Andreas Huber
Andreas Huber
Iain K. Hanson
Robert Bell
David Abrahams
E. Gladyshev
Andreas Huber
Andreas Huber
David B. Held
Andreas Huber
Johan Nilsson
Johan Nilsson
Peter Dimov
Johan Nilsson
Topher Cooper
Johan Nilsson
Johan Nilsson
Andreas Huber
Robert Bell
Andreas Huber
Andreas Huber
Andreas Huber
E. Gladyshev
Andreas Huber
Andreas Huber
E. Gladyshev
E. Gladyshev
Andreas Huber
Andreas Huber
E. Gladyshev
David Abrahams
Andreas Huber
E. Gladyshev
E. Gladyshev
Rob Stewart
E. Gladyshev
E. Gladyshev
Rob Stewart
E. Gladyshev
Rob Stewart
E. Gladyshev
Andreas Huber
Andreas Huber
E. Gladyshev
Marshall Clow
Marshall Clow
E. Gladyshev
David Abrahams
Darryl Green
E. Gladyshev
Andreas Huber
Andreas Huber
Robert Bell
Darryl Green
Pavel Vozenilek
David Abrahams
Andreas Huber
David Abrahams
Gregory Colvin
Pavel Vozenilek
Andreas Huber
Robert Bell
Andreas Huber
Johan Nilsson
Andreas Huber
Andreas Huber
Johan Nilsson
Johan Nilsson
Rob Stewart
Johan Nilsson
Andreas Huber
Andreas Huber
David Abrahams
Andreas Huber
Andreas Huber
David Abrahams
Andreas Huber
Andreas Huber
Johan Nilsson
Rob Stewart
Kwee Heong Tan
David Abrahams
Andreas Huber
David Abrahams
David Abrahams
Andreas Huber
Andreas Huber
Andreas Huber
David Abrahams
Andreas Huber
John Fuller
David Abrahams
David Abrahams
Andreas Huber
Andreas Huber
Aleksey Gurtovoy
David Abrahams
David Abrahams
David Abrahams
Andreas Huber
David Abrahams
David Abrahams

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved