|
Re: Code generation [message #430857 is a reply to message #430856] |
Fri, 12 June 2009 20:22 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Samuel,
Comments below.
Samuel wrote:
> Hi,
>
> I'm a complete newbie to the EMF framework. I'm trying to use it to
> generate code for a sequence diagram through primitives and patterns.
> For example when I have a callback primitive in my sequence diagram, I
> know that I want to generate code for a caller class and a callback
> class, and that I want to generate methods for an update operation and
> an observe_event operation. Now when I start generating code using
> EMF, the first step I take is converting my uml model to an ecore
> model. When I do this now, I only get a class (?) for the interaction
> of my sequence diagram.
Ecore is like the class diagram subset of UML, so I don't think
converting UML to Ecore will help with your sequence diagrams.
> What I want is to have classes for the lifelines I extended and
> methods in those classes for the messages I extended. To make a long
> story short, is there a way to use EMF so that it generates a class
> for every extended lifeline and a method for every extended message?
I suppose yes, but you'd have to convert your sequence diagram to Ecore
things that will generate what you want.
>
> If any of this is not clear, I can clarify further.
You could look at how UML classes are converted as a starting point...
>
> Thanks in advance,
>
> Samuel
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Re: Code generation [message #430902 is a reply to message #430893] |
Tue, 16 June 2009 21:57 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Samuel,
I imagine you'd write something much like the code in UML2 that converts
UML classes to EClasses so yes, I'm suggesting you look at the UML
source code for this.
Samuel wrote:
> Hi Ed,
>
> Thanks for your reply. :) I have a few more questions:
>
>> I suppose yes, but you'd have to convert your sequence diagram to
>> Ecore things that will generate what you want.
>
> To convert my sequence diagram into ecore elements, do I have to
> extend the EMF plugin or is there another way?
>
>> You could look at how UML classes are converted as a starting point...
>
> You mean I should look into the EMF source code to see how it's done?
>
> Cheers,
>
> Samuel
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03058 seconds