UML 2.6 RTF Avatar
  1. OMG Issue

UMLR — Coupling between StateMachines and Activities

  • Key: UMLR-31
  • Legacy Issue Number: 7620
  • Status: open  
  • Source: Simula Research Laboratory ( Dr. Bran Selic)
  • Summary:

    As I was reading through the text of issue 6114 it dawned on me that there is a needless and problematic coupling between state machines and activities. Namely, in figure 187, there is an association from ObjectNode to State, presumably to deal with the old "object in state" idea. This is similar to the coupling that was attempted but rejected in the Interactions chapter.

    While it may look attractive to have a formal link to the idea of State from state machines, there are two serious problems that make this much more trouble than it's worth:

    (1) The notion of "object state" – as seen by users/manipulators of that object – could be completely different from the implementation state of that object. This is the old principle of hiding implementation. Viewed from the outside, an invoice object may be in the "Paid" state, but this does not necessarily mean that the object has such a state in its implementation. In fact, there is no guarantee that the implementation will be based on state machines at all. Of course, you can say that this is a reference to some kind of external state machine view of an object – which sounds reasonable, but here is where the second problem comes in:

    (2) State in the UML 2.0 spec comes with a sh..load of baggage: in effect, the whole state machine kit and caboodle. It's not very modular, and, unless you use profiles to shear away all the stuff that you don't want (which is about 99% of state machines machinery), you will force vendors who innocently just want to support the simple idea of "object in state" to implement all of state machines.

    Like I say, the feature doesn't look worth it. Let your State concept be a simple name. My guess is that most users who want to use this feature don't even want to know what a state machine is (the concept of states is not necessarily linked to state machines!).

    So, my suggestion is that in figure 187, you simply provide a subclass of ObjectNode called ObjectInState and give it a "stateName" attribute and you will get what 95% of your users want. Tying state machines to activities for that one little feature seems overkill.

  • Reported: UML 2.5 — Wed, 4 Aug 2004 04:00 GMT
  • Updated: Fri, 6 Mar 2015 20:57 GMT