Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to auto generate derived features' logic code?
How to auto generate derived features' logic code? [message #414305] Tue, 30 October 2007 08:39 Go to next message
Eclipse UserFriend
Originally posted by: pwh06.mails.tsinghua.edu.cn

Hi all,



My domain model has many features that are derived from other features. So
hand coding these derived features's access methods is not a vesy easy job,
especially my demain model is always evoling. Only annotaing "generated not"
is not enough efficent. We wish define a language to describe the relation
between derived and non-derived features(we use xsd defining ecore, so our
language maybe can use xml annotations), then when we use genmodel to
generate code, derived features's logic code is also generated.



As far as I know, such senorio is not direct supported by EMF, so

1 Is my idea is viable? that mean if it will take not much efforts?

2 How to extend EMF to achieve this? which class I should inherit?

3 How do you deal with similar scenarios?

Thanks,

Wenhui Pan
Re: How to auto generate derived features' logic code? [message #414309 is a reply to message #414305] Tue, 30 October 2007 12:34 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Wenhui Pan,

OCL is a language that was designed for exactly your purpose. Have a look
at

http://www.eclipse.org/articles/article.php?file=Article-EMF -Codegen-with-OCL/index.html

and an enhancement request asking for integration of OCL and other
expression languages here:

https://bugs.eclipse.org/191689

HTH,

Christian


Wenhui Pan wrote:

>
> Hi all,
>
>
>
> My domain model has many features that are derived from other features. So
> hand coding these derived features's access methods is not a vesy easy
> job, especially my demain model is always evoling. Only annotaing
> "generated not" is not enough efficent. We wish define a language to
> describe the relation between derived and non-derived features(we use xsd
> defining ecore, so our language maybe can use xml annotations), then when
> we use genmodel to generate code, derived features's logic code is also
> generated.
>
>
>
> As far as I know, such senorio is not direct supported by EMF, so
>
> 1 Is my idea is viable? that mean if it will take not much efforts?
>
> 2 How to extend EMF to achieve this? which class I should inherit?
>
> 3 How do you deal with similar scenarios?
>
> Thanks,
>
> Wenhui Pan
Previous Topic:Multiple roots
Next Topic:impl Templates
Goto Forum:
  


Current Time: Fri Apr 19 23:06:29 GMT 2024

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

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

Back to the top