Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Modeling (top-level project) » Is there a smart way to adjust/use the EMF code generator for instances of my ecore model?
Is there a smart way to adjust/use the EMF code generator for instances of my ecore model? [message #629765] Wed, 29 September 2010 13:55 Go to next message
Bernd Vogt is currently offline Bernd VogtFriend
Messages: 34
Registered: July 2009
Member
Hi,

currently, I'm playing with a lite Android project that uses the build
in SQLite database of Android. I like Android and SQLite mutch, but when
I introduce a new SQLite table I have to write a lot of boilerplate code
(Java constants for table names, column names, create/drop/insert
statements and so on).

Now, I'm thinking about to unleash the power of modeling. I have a
little SQLite model (sqlite.ecore) to define database schmeas. For that
schemas I want to generate the boilerplate code.

Unfortunately, I'm to lazy to implement the whole code gegeration for my
SQLite models on my own and I'm spoiled by the cool features of the EMF
code generator like 'merge' and 'dynamic templates'.

Is there a smart way to adjust/use the EMF code generator in a way that
he produces code for instances of my SQLite model?

Kind regards,
Bernd
Re: Is there a smart way to adjust/use the EMF code generator for instances of my ecore model? [message #629821 is a reply to message #629765] Wed, 29 September 2010 16:06 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33218
Registered: July 2009
Senior Member
Bernd,

Please uses the EMF newgroup/forum (eclipse.tools.emf) for questions
like this.

More comments below.


Bernd Vogt wrote:
> Hi,
>
> currently, I'm playing with a lite Android project that uses the build
> in SQLite database of Android. I like Android and SQLite mutch, but
> when I introduce a new SQLite table I have to write a lot of
> boilerplate code (Java constants for table names, column names,
> create/drop/insert statements and so on).
>
> Now, I'm thinking about to unleash the power of modeling. I have a
> little SQLite model (sqlite.ecore) to define database schmeas. For
> that schemas I want to generate the boilerplate code.
>
> Unfortunately, I'm to lazy to implement the whole code gegeration for
> my SQLite models on my own and I'm spoiled by the cool features of the
> EMF code generator like 'merge' and 'dynamic templates'.
JMerge is separate reusable thing. Dynamic templates are possible too.
>
> Is there a smart way to adjust/use the EMF code generator in a way
> that he produces code for instances of my SQLite model?
I doubt it. EMF's code generator is driven by GenModel and Ecore
instances. SQLLite instances just aren't going to feed through. You
might try mapping your SQLLite instances to Ecore and the modify the
templates that produce code from Ecore; i.e., do something not unlike
how we make XML Schema instances to Ecore instances and then generate
Java that acts to implement the original schema's API and serialization.
>
> Kind regards,
> Bernd


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[Announce] Demonstrations at ESE's Modeling Symposium
Next Topic:dynamically add features to model object
Goto Forum:
  


Current Time: Wed Sep 25 18:35:18 GMT 2024

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

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

Back to the top