Book a Demo

Author Topic: UML state machines and message queues  (Read 6616 times)

Wowbagger

  • EA User
  • **
  • Posts: 69
  • Karma: +0/-0
    • View Profile
UML state machines and message queues
« on: October 27, 2009, 07:25:36 am »
Let me preface this by saying I come from a background of doing state machine design in SDL, and doing code gen from SDL.

In the code gen for UML state machines that Sparx just added, if you have states "Idle" and "Running", and a transition "Start_Running" from Idle to Running, the current code gen treats that as "Test a variable named Start_Running" rather than "receive a message called Start_Running".

Has any thought been given to allowing a more SDL like implementation, where the generated code has a message queue, and you queue a message with the value "Start_Running", and the generated state machine code then dequeues the message and compares the value against the value "Start_Running"?

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: UML state machines and message queues
« Reply #1 on: October 28, 2009, 06:41:51 am »
Hi,

May be you can achieve s.th. as you have proposed by adapting the state machine related code generation templates appropriately.

In fact there are numerous different approaches for the realization of state machines in code. I personally meanwhile prefer using the GoF State design pattern approach, after coming over others in my professional career.

I also have to check what can I do to adapt the EA CG templates to fit my framework's approach. If you want, we can further exchange about this topic in a private mail thread (you've got my adress already).

WBR
Günther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

Wowbagger

  • EA User
  • **
  • Posts: 69
  • Karma: +0/-0
    • View Profile
Re: UML state machines and message queues
« Reply #2 on: October 28, 2009, 06:53:15 am »
We can do that in mail, but I thought it would be worth sharing with the world, as there may be other folks like me out there considering the same thing.

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: UML state machines and message queues
« Reply #3 on: October 28, 2009, 07:10:41 am »
Quote
We can do that in mail, but I thought it would be worth sharing with the world, as there may be other folks like me out there considering the same thing.
Of course, as soon we have some useful results. I just know about SDL what I've read in Wikipedia a few minutes ago, and you don't know more about my approach than it's based on the State design pattern. And discussing the backgrounds felt a bit too off topic for here to me.

WBR
Günther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

Wowbagger

  • EA User
  • **
  • Posts: 69
  • Karma: +0/-0
    • View Profile
Re: UML state machines and message queues
« Reply #4 on: October 30, 2009, 08:26:31 am »
An interesting idea I and Paul Glaubitz are kicking around is to see if we can tie http://smc.sourceforge.net into EA.

We are thinking of making either a new language or a transform to convert UML into SMC's input language. Ideally, at some point we could automate that and have EA then pull the generated code back into the model.