Re: [EMF] Writing an application that writes code [message #415731] |
Fri, 04 January 2008 12:21 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Mark,
It's best to ask about EMF on the EMF newsgroup, which I've added to the
to list of the reply.
Mark Hoffmann wrote:
> Hello,
>
> I am a newcomer in the EMF topic. So first I want to explain what I
> currently do.
>
> I build a data-centric application using JEE5 server Geronimo and
> Eclipse as client. On the server I have to deploy stateless beans, JPA
> entities. On the client side I need my POJO with
> property-change-support for databinding.
EMF 2.4 has direct support for data binding of EMF objects via two new
plugins, org.eclipse.emf.databinding and
org.eclipse.emf.databinding.edit. The former operates directly on the
objects while the later uses and editing domain to execute commands to
effect changes and hence supports undo and redo. (I know some folks
have backported these plugins to work with EMF 2.3 and hence Eclipse 3.3.)
>
> I have to import the entites from the server to the client.
You'll want to keep your objects in resources and then you can serialize
it as XML and transport that between the client and the server.
> On the client I use a wrapper object for the entity the contains the
> property-change-support. I don't like that way, so I thought about an
> interface that is available on client and server because I don't want
> to bring the entity to the client and the property-change-support to
> the server. If I use the interface I need a wrapper on the server and
> on the client. To write this stuff is always the same and makes a lot
> of work. So I want to write an application that generates the code for
> the property-beans, the entities and the stateless beans, based on my
> interface.
EMF already supports notification so there shouldn't be a real need for
bean support, especially if the only goal is to integrate with data
binding. The Teneo project in EMFT support integration with Hibernate
and supports external JPA binding, so I suspect you can accomplish your
goal of persisting your objects to a database using Teneo. The
EclipseLink project is also working towards JPA support for EMF
instances some of the same folks are also committers on the Teneo project.
>
> EMF is so large I don't know if it's even possible to do such things,
> but I think so.
It's even possible to specialize the templates to generate additional
funky thing within the existing templates or to define new templates to
generate even more artifacts.
> Second I don't know where to start. I already tried the book-store
> tutorial, but it doesn't do what I want to do.
I'd need to understand if there is really a need to generate specialized
code or if the new data binding support for EMF objects in 2.4 is
sufficient. I also suspect that Teneo directly addresses your
JPA-needs. So it's maybe just a matter of reading about how to use
Teneo; it's quite easy to set up and Martin is very fast at answering
questions on the EMFT newsgroup about it.
> Can you help me giving an entry to EMF regarding this topic.
>
> Thanks,
> Mark
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02763 seconds