Re: Designing my finite state machine

From: Robert C. Martin (unclebob_at_objectmentor.com)
Date: 03/14/05


Date: Mon, 14 Mar 2005 16:54:54 -0600

On Mon, 14 Mar 2005 12:58:27 +0100, Remi Bastide
<FirstName.LastName@irit.fr> wrote:

>Robert C. Martin <unclebob@objectmentor.com> wrote:
>
>>On Thu, 10 Mar 2005 21:37:14 +0100, "Matthias Hofmann"
>><hofmann@anvil-soft.com> wrote:
>>
>>Matthias,
>>
>>It is generally a good idea to separate event identification from the
>>finite state machine itself. The firing of a transition is a boolean
>>event. That event can be given a name (e.g. start, done, complete).
>>
>>What you have described are a set of flags and conditions that have to
>>be boiled down into single events. I strongly suggest you do this
>>boiling outside of the FSM proper, so that the FSM sees only the
>>boolean events.
>>
>>As an aid, I suggest you download SMC from:
>>http://www.objectmentor.com/resources/downloads/index
>>
>
>I'm surprised that you suggest to transform these "flags and
>conditions" into events. To me, it appears that they would better be
>modelled as (sub-)states. A boolean flag to me is just one part of the
>state space, that should be modelled as a state as much as it remains
>convenient.

I quite agree. As much as is possible I like to eliminate all the
flags and conditions and collapse them down into raw states. However,
this is not always possible. When it's not, I connive to get the
extra conditions and flags represented as events. Often by using
activity states.

-----
Robert C. Martin (Uncle Bob) | email: unclebob@objectmentor.com
Object Mentor Inc. | blog: www.butunclebob.com
The Agile Transition Experts | web: www.objectmentor.com
800-338-6716

"The aim of science is not to open the door to infinite wisdom,
 but to set a limit to infinite error."
    -- Bertolt Brecht, Life of Galileo



Relevant Pages

  • Re: Designing my finite state machine
    ... The firing of a transition is a boolean ... boiling outside of the FSM proper, so that the FSM sees only the ... "The aim of science is not to open the door to infinite wisdom, ...
    (comp.object)
  • Re: Designing my finite state machine
    ... The firing of a transition is a boolean ... >What you have described are a set of flags and conditions that have to ... >boiling outside of the FSM proper, so that the FSM sees only the ...
    (comp.object)
  • Re: Need help with SELECT statement.
    ... How do you cast these bits to Boolean? ... in various programming ... What are called the X3J languages ... This is not the same as using flags for program control (flag ...
    (microsoft.public.sqlserver.programming)
  • Re: Bitwise And
    ... I did try to ensure I got the correct conversion from hexadecimal to ... The first Flags value that there is a problem with is 1048576. ... > I have also converted the results to be Boolean, ... Specifying a return type is certainly a good idea, ...
    (microsoft.public.access.queries)
  • Re: Need help with SELECT statement.
    ... How do you cast these bits to Boolean? ... in various programming ... What are called the X3J languages ... This is not the same as using flags for program control (flag ...
    (microsoft.public.sqlserver.programming)