Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Using MultiResourceEObject
Using MultiResourceEObject [message #417459] Tue, 11 March 2008 20:44 Go to next message
Campbell McCausland is currently offline Campbell McCauslandFriend
Messages: 13
Registered: July 2009
Junior Member
I have a situation where I have containment relations that I want to
persist in separate resources. From the javadoc description of
MultiResourceEObject, it looks like it is designed to do exactly what I
need, but I cannot find any documentation on its use. Can anyone point
me in the right direction?
Re: Using MultiResourceEObject [message #417460 is a reply to message #417459] Tue, 11 March 2008 20:54 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Campbell,

You need to ensure that the GenModel's Containment Proxies flag is set
to true. Once you do that, any containment reference for which
EReference.isResolveProxies is true (which is the default) will allow
those references to be rooted in a difference resource. Ecore itself
has two examples of this EPackage.eClassifiers, and
EPackage.eSubPackages. You'll note you can click of an EClassifier or
nested EPackage and invoke "Control..." to specify a different resource
to contain that object.


Campbell McCausland wrote:
> I have a situation where I have containment relations that I want to
> persist in separate resources. From the javadoc description of
> MultiResourceEObject, it looks like it is designed to do exactly what
> I need, but I cannot find any documentation on its use. Can anyone
> point me in the right direction?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using MultiResourceEObject [message #417461 is a reply to message #417459] Tue, 11 March 2008 21:01 Go to previous messageGo to next message
Campbell McCausland is currently offline Campbell McCauslandFriend
Messages: 13
Registered: July 2009
Junior Member
I just noticed that this class is not part of EMF, but part of the
Eclipse Process Framework project. Sorry, if I sent you off searching
for it :)

However, perhaps someone can comment on the need for such support.

For provide more detail, say I was creating some kind of java modeling
tool that contained packages. I would like to have EMF store the data
for each package its own file, even (and this is central to my
challenge) those packages which are nested within another.

I want each modeled Package to map to both a Folder resource (to
preserve namespace semantics) and to a File resource (that contains the
actual package data such as its name and its contents).

Is it easy to have EMF do this, or do I need to abstract a class like
org.eclipse.epf.uma.ecore.impl.MultiResourceEObject to do it?
Re: Using MultiResourceEObject [message #417462 is a reply to message #417460] Tue, 11 March 2008 21:03 Go to previous messageGo to next message
Campbell McCausland is currently offline Campbell McCauslandFriend
Messages: 13
Registered: July 2009
Junior Member
Thanks Ed. Looks like you beat me to my own answer!
Re: Using MultiResourceEObject [message #417463 is a reply to message #417461] Tue, 11 March 2008 21:06 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Campbell,

I just ignore things I don't understand. :-P

In general, with the advent of support for cross resource containment,
you can literally put every object in a different resource if you want
that. Even the simple library tutorial example supports this type of
thing. I.e., create two libraries, one with books and the other with
writer, open one and use Load Resource... to open the other, and the
create relations between writers and books. These will serialize as
cross resource references...


Campbell McCausland wrote:
> I just noticed that this class is not part of EMF, but part of the
> Eclipse Process Framework project. Sorry, if I sent you off searching
> for it :)
>
> However, perhaps someone can comment on the need for such support.
>
> For provide more detail, say I was creating some kind of java modeling
> tool that contained packages. I would like to have EMF store the data
> for each package its own file, even (and this is central to my
> challenge) those packages which are nested within another.
>
> I want each modeled Package to map to both a Folder resource (to
> preserve namespace semantics) and to a File resource (that contains
> the actual package data such as its name and its contents).
>
> Is it easy to have EMF do this, or do I need to abstract a class like
> org.eclipse.epf.uma.ecore.impl.MultiResourceEObject to do it?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using MultiResourceEObject [message #417464 is a reply to message #417462] Tue, 11 March 2008 21:06 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Campbell,

You gotta be pretty quick to pull a fast one on me!


Campbell McCausland wrote:
> Thanks Ed. Looks like you beat me to my own answer!


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:How to extend/import ePackages?
Next Topic:EMF WSDL Xmlschema
Goto Forum:
  


Current Time: Thu Apr 25 14:16:37 GMT 2024

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

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

Back to the top