
Unfortunately, Google Plugin’s project wizard produces merely a "hello world" type application, so there remains a great deal to learn before you can do anything truly interesting following best practices. Now, where Google Plugin’s tools trail off, EMF's tools kick in. Starting with a simple description of your data structures, you can generate a fully functional application focused specifically on your domain of interest. My demo at Google’s Eclipse Day last month showed this in action. Now, with the help of my colleagues at Cloudsmith, we have everything nicely packaged up so you can easily try it at home. It’s all documented in the EMF for GWT wiki. Prepare to soar into the clouds.
Of course those of you familiar with Eclipse modeling know that EMF produces simple natural APIs of hand written quality in which complex relationships are simply expressed. But those of you more familiar with GWT and App Engine, and with technologies like Roo, will likely expect to be dealing with Data Transfer Objects that describe denormalized models which are mapped via JPA onto App Engine Datastore’s entity-based back-end. It’s tedious, painful and stilted, not to mention totally unnecessary. Just say no to DTO. With EMF, you can focus on the creative task of describing your domain, rather than on the tedious task of mapping high level concepts onto low-level persistence technologies, and you can exploit REST to its fullest. EMF is truly a smith for the cloud.


9 comments:
Hi Ed, this sounds great. I must give it a try on wednesday. But how about persistence, what way would you go for ?
Datastore's entity-based approach doesn't require an object-relational decomposition. EMF's objects map quite nicely onto entities with properties...
The problem with this simple decomposition is that queries take relatively long, so it's all too easy to exceed the 30 second App Engine window with just few hundred queries. Therefore, in this initial design, we've chosen to use a binary serialization that easily allows one to store large numbers of objects compactly.
It will certainly be interesting to get feedback, i.e., to work with real clients working on real applications...
Thanks. This is really cool.
An example how to use EMF only as data model (and not the EMF generated application) would also be great.
I rarely use the EMF generate UI's but like to use EMF for the domain model.
I think it would be great to have an example how EMF could be used in a traditional GWT application. For example how could the domoin model in the stockwatcher example http://code.google.com/webtoolkit/doc/1.6/tutorial/create.html be modeled with EMF.
Hi Ed,
nice post. I like the idea of saving data in EMF models. Especially if you can rely on CDO as persistence...
I can not agree with your DTO statement. It might be OK for a tiny data requirement of an google app. If you are in a serious enterprise systems scenario, you would be happy to separate concerns of data input/presentation, processing and storage. I would prefer the world without DTOs too, but it happens too seldom that you can really omit them.
In fact I would solve the problem of different data represention in different levels using EMF/Xtext approach. Creating a DSL for persistence, a DSL for DTO represnetation and a mapping DSL will still allow to focus on the creative part, instead of the boilerplate code. But it works only for projects of certain size...
Hi Ed,
I have successfully followed the tutorial "EMF for GWT wiki": great work!!!
Now I would like to share some changes I had to apply in order to get to the result:
- when installing the EMF and GWT toolkits I've got repeatedly problems with the "Google plugin for Eclipse 3.6" (vers. 1.3.3). So I installed just EMF 2.7 and XSD 2.7 and then installed Google plugin from http://google-web-toolkit.googlecode.com/svn/2.1.0.M3/eclipse/plugin/3.6 (just "Google plugin for Eclipse 3.6" here, for now)
- when installing Google App Engine I downloaded it from http://code.google.com/intl/it-IT/appengine/downloads.html; I tried both the .msi Windows installer (requires Python and other stuff, which I installed) and also the "Linux/Other Plaforms" generic zip. But for both I then was not able to set a valid path in the Preferences. Then installed from the same GWT Update site of the previous point (this way the App Engine preference is automatically set, without having to do it manually)
- after having set the Target Platform to the Update site "EMF for GWT Runtime" and having made an EMF Project with an Ecore model, I had an error on MANIFEST.MF saying that org.eclipse.emf.ecore could not be resolved! Indeed the Target Platform was made of just a few emf-gwt plugins right now. Then I added ${eclipse_home} to the Target Platform in order to have both emf-gwt plugins and also all the others. Now it worked.
- after right-clicking on Run as Web Application on the editor plugin, I wasn't able to see nothing at browser at URL indicated in console (http://localhost:8888/). After googling for a while I tried http://localhost:8888/?gwt.codesvr=127.0.0.1:9997
This way it worked great!
Now a question: how can I customize the GWT module in order to have a different UI, but still having EMF under the hood?
Thank you again Ed
and see you next week at ESE 2010!
Bye
Vincenzo Caselli
RCP Vision
Vincenzo,
See you tomorrow. There are a bunch of things you could do with what's generated. For example, you could just use the model instances in your regular service APIs; they support GWT serialization. You could also make use of the resource framework changes to communicate between the client and server via that mechanism. It's also possible to write your own UI instead of using the generic editor. I'll need to find time to document all these possibilities.
Hi Ed,
Nice seeing your talk at ESE 2010. That's an impressive piece of work. I started playing a bit with EMF over GWT for a personal project. The editor seems pretty heavy in term of code and initializing. I want my app to load very fast ( mobile phone ) with very low overhead but I'd like to keep EMF's power for my objects cross referencing. So started to use EMF on the server side sending bundles of lightweight objects to the client, It seems I can't use the provided URIHandler on the server side to persist the model because it uses an AsyncCallback, and it looks like I can't use my EMF's objects as the lightweight model : they don't serialize. Another point still not very clear to me in the GWT editor, it looks the whole resource is loaded once in the client part, how do you deal with big models ? how do you guaranty the commit when saving the same model from multiple clients as from what I understood, the whole resource is written back in the datastore. So the more shared object the more contention ? Looks like I missed something right ?
What's the status on this? I'm having some issues with both the recommended GWT and the latest.
Post a Comment