|
Re: Change getter/setter names [message #653512 is a reply to message #653418] |
Thu, 10 February 2011 03:54 |
|
Am 09.02.2011 17:53, schrieb J.-P. Pellet:
> Hi,
>
> I'm experimenting with integrating EMF and Scala a bit more tightly. As a first step, I'd like my generated code to have getters called featureName(), and setters called featureName_$eq(...) for nicer Scala interoperability.
Personally I feel that an integration should be "a third thing", as non-invasive to the two things that are to be integrated. I would recommend that you investigate ways to use EMF reflection and introspection for your integration. But I know almost nothing about Scala and if that would be appropriate for Scala.
>
> (This has the effect that I can say "obj.featureName" to get it and "obj.featureName = newValue" to set it in Scala.)
>
> Is there a way to easily modify how the generator does this, or should I rewrite my own complete generator?
>
> (Eventually, I guess rewriting the whole generator in a Scala-idiomatic way would be best, but I want to start simple.)
Before you start to adjust or rewrite the actual JET templates I would investigate if you could customize the GenModel implementation. Things like the accessor names are computed in GenFeatureImpl.getGetAccessor(). I've never done that before and tere may be more dependencies you'd have to consider.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03250 seconds