Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Help! Not understanding state machine diagram to implementation
Help! Not understanding state machine diagram to implementation [message #628499] Mon, 07 June 2010 12:47 Go to next message
Anthony William is currently offline Anthony WilliamFriend
Messages: 6
Registered: June 2010
Junior Member
Hello,

I've been playing with the UML2 and UML2Tools components for a few days now. I can create diagrams with states, triggers, and activities. Then I'm able to use EMF to generate my model code.

But I'm really struggling on understanding how to use the model java classes.

I look at my state machine class and the switch class and all I really see of importance is a doSwitch method. So basically I'm not understanding how this code works to move through states and interact with events, triggers, and activities.

I know that the generated class aren't going to do everything for me and that I will have to write additional code, it's just that I don't see the hooks as to where I would add this code.

Any help or links to previous topics on this (I did do some searching already) would be great.

Anthony
Re: Help! Not understanding state machine diagram to implementation [message #628502 is a reply to message #628499] Mon, 07 June 2010 13:30 Go to previous message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 847
Registered: July 2009
Senior Member
Hi, Anthony,

The MDT UML2 project's code generation is only roughly equivalent to the
class diagramming subset of UML. It will generate the structure of
classes, but there is no support for generating behaviour except
inasmuch as in can be specified as OCL or Java-snippet annotations.

If you are using MDT UML2 only, then you will get a Java class (and an
Ecore EClass) generated for your state machine only because a UML state
machine is a kind of class. But the code that is generated will be as
meaningless as the class structure of any state machine.

If you are using some tool that purports to generate behaviour from
state machines, then this is not the right newsgroup.

HTH,

Christian


On 07/06/10 08:47 AM, Anthony William wrote:
> Hello,
>
> I've been playing with the UML2 and UML2Tools components for a few days
> now. I can create diagrams with states, triggers, and activities. Then
> I'm able to use EMF to generate my model code.
>
> But I'm really struggling on understanding how to use the model java
> classes.
>
> I look at my state machine class and the switch class and all I really
> see of importance is a doSwitch method. So basically I'm not
> understanding how this code works to move through states and interact
> with events, triggers, and activities.
> I know that the generated class aren't going to do everything for me and
> that I will have to write additional code, it's just that I don't see
> the hooks as to where I would add this code.
>
> Any help or links to previous topics on this (I did do some searching
> already) would be great.
>
> Anthony
Previous Topic:Re: Help! Not understanding state machine diagram to implementation
Next Topic:Help! Not understanding state machine diagram to implementation
Goto Forum:
  


Current Time: Sat Dec 20 15:17:52 GMT 2014

Powered by FUDForum. Page generated in 0.04443 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software