modifying ecore and codegen behaviour [message #545339] |
Wed, 07 July 2010 09:29  |
Eclipse User |
|
|
|
Hi all
I try to - in my view - slightly modify the code generation of the plain vanilla EMF ecore / codegen products. But I do not seem to get anywhere. there is always something either not working as expected, or - more frequently - not working at all.
I aim to:
- create a gen model that offers many fewer editable options (I don't want my developers to be able to make mistakes here) with our desired code-gen setup hardcoded
- change code generation to generate the model implementation into a bundle separate from the interface
- add to all model parts (EClass, EPackage, etc) a first class 'documentation' attribute that is meant to contain all documentation.
I have tried many approaches but seem to drift towards duplicating / subclassing most every part of the framework (i.e. the gen model, the org.eclipse.emf.codegen.ecore.genmodel.generator.GenModelGen eratorAdapterFactory, etc)
My question: am I missing something here, or am I on the right track to obtain the effects I want?
thanks in advance for any feedback
/stefan
|
|
|
Re: modifying ecore and codegen behaviour [message #545357 is a reply to message #545339] |
Wed, 07 July 2010 09:41   |
Eclipse User |
|
|
|
Stefan,
Comments below.
stefan wrote:
> Hi all
>
> I try to - in my view - slightly modify the code generation of the
> plain vanilla EMF ecore / codegen products. But I do not seem to get
> anywhere. there is always something either not working as expected, or
> - more frequently - not working at all.
>
> I aim to:
> - create a gen model that offers many fewer editable options (I don't
> want my developers to be able to make mistakes here) with our desired
> code-gen setup hardcoded
You don't need a new GenModel, just your own editor with your own views,
right?
> - change code generation to generate the model implementation into a
> bundle separate from the interface
You'll have problems with XyzPackage/XyzFactory eINSTANCE needing to
refer to the implementation.
> - add to all model parts (EClass, EPackage, etc) a first class
> 'documentation' attribute that is meant to contain all documentation.
There is already support for a documentation annotation; see
EcoreUtil.getDocumentation.
>
> I have tried many approaches but seem to drift towards duplicating /
> subclassing most every part of the framework (i.e. the gen model, the
> org.eclipse.emf.codegen.ecore.genmodel.generator.GenModelGen
> eratorAdapterFactory, etc)
> My question: am I missing something here, or am I on the right track
> to obtain the effects I want?
It's best to ask about EMF things on the EMF newsgroup.
>
> thanks in advance for any feedback
>
> /stefan
|
|
|
|
Re: modifying ecore and codegen behaviour [message #619734 is a reply to message #545339] |
Wed, 07 July 2010 09:41   |
Eclipse User |
|
|
|
Stefan,
Comments below.
stefan wrote:
> Hi all
>
> I try to - in my view - slightly modify the code generation of the
> plain vanilla EMF ecore / codegen products. But I do not seem to get
> anywhere. there is always something either not working as expected, or
> - more frequently - not working at all.
>
> I aim to:
> - create a gen model that offers many fewer editable options (I don't
> want my developers to be able to make mistakes here) with our desired
> code-gen setup hardcoded
You don't need a new GenModel, just your own editor with your own views,
right?
> - change code generation to generate the model implementation into a
> bundle separate from the interface
You'll have problems with XyzPackage/XyzFactory eINSTANCE needing to
refer to the implementation.
> - add to all model parts (EClass, EPackage, etc) a first class
> 'documentation' attribute that is meant to contain all documentation.
There is already support for a documentation annotation; see
EcoreUtil.getDocumentation.
>
> I have tried many approaches but seem to drift towards duplicating /
> subclassing most every part of the framework (i.e. the gen model, the
> org.eclipse.emf.codegen.ecore.genmodel.generator.GenModelGen
> eratorAdapterFactory, etc)
> My question: am I missing something here, or am I on the right track
> to obtain the effects I want?
It's best to ask about EMF things on the EMF newsgroup.
>
> thanks in advance for any feedback
>
> /stefan
|
|
|
|
Powered by
FUDForum. Page generated in 0.07168 seconds