Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [EMF] URI and Content Handler
[EMF] URI and Content Handler [message #753568] Thu, 27 October 2011 18:36 Go to next message
Mauricio Reyes is currently offline Mauricio ReyesFriend
Messages: 26
Registered: August 2011
Junior Member
Hi,

I'm trying to extend EMF by writing my own ResourceSet and Resources that communicate with a server through an own business delegate. The generated classes from genmodel will be both in client and server as I want to define my instances and associations in client side and just transfer them to server to validation and persistence. I think I've solved the methods I need to extend in Resource (doLoad and doSave invoke the business delegate) but I don't completely understand where or what should I change to modify the logic asociated with loading of resources, because I want to load objects in different resources depending on how deep they are in the tree, working with proxys to manage references to objects in lower levels, and I think I should make that division using an appropriate uri scheme.
I was trying to understand using the example of MongoDB EMF (https://github.com/BryanHunt/mongo-emf) and I think having my own URIHandler and/or InputStream is the correct way to solve my problem, but I'm not understanding how should I manage URIs to create resources.

I'm sorry for being so vague with the description, if anyone need more details about something just ask.

In conclusion, I need some clue about how can I adapt things in EMF to obtain the objects from a server and load them in different resources that are defined by the URI and not predefined like the default XML files method.
Re: [EMF] URI and Content Handler [message #753598 is a reply to message #753568] Thu, 27 October 2011 23:27 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Comments below.

On 27/10/2011 8:37 PM, maureyeslopez wrote:
> Hi,
>
> I'm trying to extend EMF by writing my own ResourceSet and Resources
> that communicate with a server through an own business delegate.
Like CDO?
> The generated classes from genmodel will be both in client and server
> as I want to define my instances and associations in client side and
> just transfer them to server to validation and persistence. I think
> I've solved the methods I need to extend in Resource (doLoad and
> doSave invoke the business delegate)
That's mostly to specialize the format for saving. What you've
described could be accomplished with XML or binary...
> but I don't completely understand where or what should I change to
> modify the logic asociated with loading of resources, because I want
> to load objects in different resources depending on how deep they are
> in the tree,
You decide how to partition your objects into resources....
> working with proxys to manage references to objects in lower levels,
> and I think I should make that division using an appropriate uri scheme.
Any URI scheme can support this.
> I was trying to understand using the example of MongoDB EMF
> (https://github.com/BryanHunt/mongo-emf) and I think having my own
> URIHandler and/or InputStream is the correct way to solve my problem,
> but I'm not understanding how should I manage URIs to create resources.
Using URIConverter.Saveable/Loadable, you can separate out the logic for
saving your resource into a specialized "stream".
>
> I'm sorry for being so vague with the description, if anyone need more
> details about something just ask.
It's up to you to provide suitable questions.
>
> In conclusion, I need some clue about how can I adapt things in EMF to
> obtain the objects from a server and load them in different resources
> that are defined by the URI and not predefined like the default XML
> files method.
When the client asks the server for the contents of a URI, the server
decides what bytes to send. It can send those as XML or binary.
There's nothing predefined. You decide what objects belong in each
resource and you can decide how to represent them. XML or binary will
be fine for communicating between the client and the server. The
server can store and fetch using a data base, Mongo DB, or whatever you
want.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:EMF CDO and GWT
Next Topic:[CDO] CDO client and server version compatibility
Goto Forum:
  


Current Time: Fri Apr 19 09:18:55 GMT 2024

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

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

Back to the top