How to auto generate derived features' logic code? [message #414305] |
Tue, 30 October 2007 08:39 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02714 seconds