Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Code generation
Code generation [message #430856] Fri, 12 June 2009 20:05 Go to next message
Samuel Mising name is currently offline Samuel Mising nameFriend
Messages: 31
Registered: July 2009
Member
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. 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?

If any of this is not clear, I can clarify further.

Thanks in advance,

Samuel
Re: Code generation [message #430857 is a reply to message #430856] Fri, 12 June 2009 20:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
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 #430893 is a reply to message #430857] Tue, 16 June 2009 14:39 Go to previous messageGo to next message
Samuel Mising name is currently offline Samuel Mising nameFriend
Messages: 31
Registered: July 2009
Member
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
Re: Code generation [message #430902 is a reply to message #430893] Tue, 16 June 2009 21:57 Go to previous message
Ed Merks is currently offline Ed MerksFriend
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/
Previous Topic:Simple EMFT ModelValidationService example
Next Topic:getEObjectsByAttributeValue
Goto Forum:
  


Current Time: Fri Apr 26 07:14:10 GMT 2024

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

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

Back to the top