Home » Modeling » EMF » Multiple roots
| |
Re: Multiple roots [message #414292 is a reply to message #414282] |
Mon, 29 October 2007 18:48 |
Tomas Zijdemans Messages: 90 Registered: July 2009 |
Member |
|
|
Thanks for helping Ed!
Ed Merks wrote:
> Tomas,
>
> I'm not sure I understand the Professor-Author relation nor specifically
> what you are asking in terms of "handling" it. Maybe you could provide
> a few more details...
Sorry for explaining a bit poorly. My real case has 7 editors,
containing 3 diagram elements (roots) and about 50 model elements - so I
tried to simplify. Let me give it another go:
1. In the first editor, Library is the root. Book objects and Author
objects can be created - they have some attributes and a relation to
each other. Author has a relation/connection to, one or more, Professor
objects - but Professors are not contained by the Library root (Because
they belong in a different editor).
2. In the second editor, University is the root. Professor objects can
be created. Professors have some attributes and a relation/connection to
one, and only one, Author object.
The user will have both editors opened at the same time. Create an
Author (in the first editor), then a Professor (in the second editor).
Furthermore the user - in some way - should be able to select a
Professor object (in the second editor), and then be able to relate it
to an Author object (in the first editor) or visa vera.
This is taken a bit out of context (to save time and space), but should
give you the general picture.
Thanks,
Tomas
>
> Tomas Zijdemans wrote:
>> I need some advice regarding multiple roots (Diagram Elements).
>>
>> Consider this scenario:
>>
>> 1. Library contains Book and Author (They relate to each other).
>> 2. University contains Professor.
>> 3. Professor and Author have a opposite relation to each other (1,*)
>>
>> Since library and university are opened as two separate editors (with
>> their own resource), how can this relation be handled?
>>
>>
>> Best regards,
>>
>> Tomas
|
|
|
Re: Multiple roots [message #414295 is a reply to message #414292] |
Mon, 29 October 2007 19:02 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Tomas,
The properties view will generally allow you to select any object that's
reachable within the editor, so it sounds like it will be necessary to
use the editor's "Load Resource..." action to either load the Library
for it to be visible to the University editor or to load the University
so it will be visible to the Library editor. Once you load the
resource, the Professors/Authors should be available so you can populate
the references between them.
Tomas Zijdemans wrote:
> Thanks for helping Ed!
>
> Ed Merks wrote:
>> Tomas,
>>
>> I'm not sure I understand the Professor-Author relation nor
>> specifically what you are asking in terms of "handling" it. Maybe
>> you could provide a few more details...
>
> Sorry for explaining a bit poorly. My real case has 7 editors,
> containing 3 diagram elements (roots) and about 50 model elements - so
> I tried to simplify. Let me give it another go:
>
> 1. In the first editor, Library is the root. Book objects and Author
> objects can be created - they have some attributes and a relation to
> each other. Author has a relation/connection to, one or more,
> Professor objects - but Professors are not contained by the Library
> root (Because they belong in a different editor).
>
> 2. In the second editor, University is the root. Professor objects can
> be created. Professors have some attributes and a relation/connection
> to one, and only one, Author object.
>
> The user will have both editors opened at the same time. Create an
> Author (in the first editor), then a Professor (in the second editor).
> Furthermore the user - in some way - should be able to select a
> Professor object (in the second editor), and then be able to relate it
> to an Author object (in the first editor) or visa vera.
>
>
> This is taken a bit out of context (to save time and space), but
> should give you the general picture.
>
> Thanks,
>
> Tomas
>
>>
>> Tomas Zijdemans wrote:
>>> I need some advice regarding multiple roots (Diagram Elements).
>>>
>>> Consider this scenario:
>>>
>>> 1. Library contains Book and Author (They relate to each other).
>>> 2. University contains Professor.
>>> 3. Professor and Author have a opposite relation to each other (1,*)
>>>
>>> Since library and university are opened as two separate editors
>>> (with their own resource), how can this relation be handled?
>>>
>>>
>>> Best regards,
>>>
>>> Tomas
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| | | |
Re: Multiple roots [message #414308 is a reply to message #414307] |
Tue, 30 October 2007 12:23 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Tomas,
If you're using EMF 2.3, it should verify that the Ecore model is well
formed at the time you load the GenModel.
I don't really see how your idea would work, objects are contained by
other objects and the root object is contained by a resource, which is
contained by a resource set. These are all literally containment-type
relationships, i.e., an object can only be contained in one resource set
because eObject.eResource().getResourceSet() can only give one answer...
Tomas Zijdemans wrote:
> Ed Merks wrote:
>> Tomas,
>>
>> For a properly defined bidirectional reference not to properly update
>> both seems virtually impossible given how many years this has been in
>> use. So you'll understand that I'm doubtful. Which version of EMF
>> are you using?
>
> I'm using 2.3.1, but as you suggest, it's probably something I've
> overlooked.
>
> I got another idea last night when I couldn't sleep:
>
> Would it be possible to create a second resource (set), and add new
> model elements to this as well (It would be a "super" resource,
> holding all elements from different editors). Then I could Iterate
> through this new super resource and ex. catch all Professor objects -
> regardless of where they have been created.
>
> Crazy idea?
>
>
> Regards,
>
> Tomas
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Sat Apr 27 03:40:54 GMT 2024
Powered by FUDForum. Page generated in 0.03762 seconds
|