Generic adapter generation toolchain [message #1176800] |
Fri, 08 November 2013 15:09 |
Felix Dorner Messages: 295 Registered: March 2012 |
Senior Member |
|
|
Hi,
maybe I'm shot by a silverish bullet and haven't yet noticed, but very
often I solve "processing" problems for our models by extending the
generated adapter factories to produce adapters for a specific task.
Until now I always did this "by hand", which works okay, especially
because the adapters I need are very sparsely customized (say 10 out of
a 100 types need specific tuning, the rest is treated by a default
implementation).
Another characteristic of my pattern is that the adapters are most often
short-lived; I don't need to react to model changes, and thus don't ever
attach produced adapters.
But it gets repetitive, so what I'd like to have is a generator that
takes 3 ingredients as input: A genmodel, possibly with annotations or
maybe even an extended genmodel; one or more interface definitions; a
base implementation for the required interfaces (Just like
ItemProviderAdapter.java in the EMF.Edit case). The output would be a
readily usable adapter hierarchy. I wouldn't care having to compose the
generated factories manually.
Is there maybe already an existing tool that goes into that direction?
For now I rolled my own, but it's still a bit quirky.
Cheers,
Felix
|
|
|
Re: Generic adapter generation toolchain [message #1176812 is a reply to message #1176800] |
Fri, 08 November 2013 15:18 |
|
Hi, Felix,
EMF's code generation framework provides for extensibility via
pluggable "generator adapters." This mechanism may suit your needs.
Have a look at the "Generator Extension Example" in the EMF examples
wizard.
HTH,
Christian
On 2013-11-08 15:09:01 +0000, Felix Dorner said:
> Hi,
>
> maybe I'm shot by a silverish bullet and haven't yet noticed, but very
> often I solve "processing" problems for our models by extending the
> generated adapter factories to produce adapters for a specific task.
>
> Until now I always did this "by hand", which works okay, especially
> because the adapters I need are very sparsely customized (say 10 out of
> a 100 types need specific tuning, the rest is treated by a default
> implementation).
>
> Another characteristic of my pattern is that the adapters are most
> often short-lived; I don't need to react to model changes, and thus
> don't ever attach produced adapters.
>
> But it gets repetitive, so what I'd like to have is a generator that
> takes 3 ingredients as input: A genmodel, possibly with annotations or
> maybe even an extended genmodel; one or more interface definitions; a
> base implementation for the required interfaces (Just like
> ItemProviderAdapter.java in the EMF.Edit case). The output would be a
> readily usable adapter hierarchy. I wouldn't care having to compose the
> generated factories manually.
>
> Is there maybe already an existing tool that goes into that direction?
> For now I rolled my own, but it's still a bit quirky.
>
> Cheers,
> Felix
|
|
|
Powered by
FUDForum. Page generated in 0.03290 seconds