Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Generic adapter generation toolchain
Generic adapter generation toolchain [message #1176800] Fri, 08 November 2013 15:09 Go to next message
Felix Dorner is currently offline Felix DornerFriend
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 Go to previous message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 1195
Registered: July 2009
Location: Canada
Senior Member

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
Previous Topic:Custom Edatatype with ecore model editor
Next Topic:TreeViewer collapsing after saving
Goto Forum:
  


Current Time: Mon Aug 19 13:19:34 GMT 2019

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

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

Back to the top