Taking EMF to the third tier: the Texo JSON Resource
After supporting a 2-tier architecture it is now time to make the step to a full 3-tier application architecture for EMF based RCP’s connected to a standard JPA web server. The server side of this 3-tier architecture was already done earlier: the Texo JSON web service layer. The only remaining topic was implementing the client side: an EMF resource which talks JSON with the server.
Well a first version is available now: the JSONTexoResource. This resource uses JSON to communicate with a server with JPA entities generated from ecore models using Texo.
The nice thing is that the JSONTexoResource transparently works with EMF Proxies. So EMF proxies are automatically resolved by sending a HTTP request to the server and getting the content of the object.
It is easy to override Texo code to add authentication support to the HTTP communication layer. An additional nice feature is that the server side can change/update objects when they are being persisted. Server-side changes are send back to the client (executing the persist action) and merged with the client side objects.
The Texo Resource also support loading objects using queries, counting, retrieving and refreshing individual objects (from the server) and cross-reference queries.
For more information:
- specifics on the JSONTexoResource can be found here
- for setting up the server side is check out this wiki page or see this video.