1 reply Latest Post - ‏2013-04-18T08:57:24Z by HisMastersVoice
48 Posts

Pinned topic start() or startDispatching() ?

‏2013-03-21T18:45:20Z |
I have a class with a state chart in it.
We made some tests in order to know if it was better to make the class Active or Sequential.
In the end, we chose Active.

The problem when you make those kind of tests is that some automtic code disappear.
That is the case with the code inside startBehavior(): when you switch from Sequential to Active, you don't end up with the original code as when it was Active right at the beginning.
Since our code base is quite large, I saw that, in the startBehavior() method, some developers call start() and some others call startDispatching().
As far as I know, Rhapsody uses start().

What's the difference between the two methods?
Which one is better?

Using Rhapsody 7.5.1 for C++ developers
  • HisMastersVoice
    46 Posts

    Re: start() or startDispatching() ?

    ‏2013-04-18T08:57:24Z  in response to MaitreBart

    Rhapsody introduced a new, interface based realization of OXF in RiCpp with v6.0.

    The new v6.0 OXF architecture introduced OMThread::startDispatching() in order to avoid accidental overriding of start(), which is a very common name.
    The old v5.x OXF API calls like OMThread::start() were redirected to calls of the new API, the old calls were kept as 'deprecated' calls for compatibility reasons for a while.

    With (or after?) Rhapsody v7.5 the backward compatibility to the old API was removed.

    In any case, the operation startBehavior() should be a generated operation, not handcoded by the user.
    If backward compatibility properties are still set on project level, Rhapsody will indeed generate the call to the old API.

    In general it is recommended to use the new OXF API... in your case this means startDispatching()