Subject: Re: [boost] [msm] Version 2.0 available
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2009-11-11 11:55:15
>Apologies if this is a silly question as I'm not familiar with earlier
>versions of MSM, but how does this library different from Boost.Statechart?
This is not a silly question but one which is begging for controversy ;-)
I hope this is not starting a flame war, so from my understanding,
there are advantages of using Msm on several points:
- speed: Msm is much faster than statechart (see the performance page.
Usually more than 20 times faster).
* Msm makes heavier use of metaprogramming = longer compilation, higher speed
* No RTTI and no virtual functions
* Msm tries to follow the principles of declarativeness described
in the book "C++ Template Metaprogramming". This leads to an
interface, which is, in my opinion, easier to use.
* Again in my opinion, entry/exit/guards are better with Msm. With
Statechart, you have to write guard handling yourself and you don't
get the event as parameter in the entry/exit.
* Actions / guards are more reusable as you can provide a functor object
* States are also more reusable as they don't know their containing
state machine or other states (due to in-state transition-table
definition in Statechart)
- UML support. Msm supports forks, UML-conform event dispatching in
orthogonal regions (which is that every region gets a chance to handle
a given event), entry/exit pseudostates and anonymous transitions
(transitions without an event).
Msm also supports different frontends. For example, eUML tries to hide
metaprogramming as much as possible and tries to look like an UML
This also help writing state machines easier with Msm.
- Model-Driven approach. You will find in the doc directory my
BoostCon paper (the only PDF) where I describe my analysis of MDD with
But this is ultimately a matter of taste (as I will of course prefer
Msm and Andreas will likely prefer Statechart), and you should take
whatever fits your needs better and you are more comfortable with, so
I'd advise you to look at both and see what you prefer (and even
better, what I could do to improve Msm).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk