Home » Modeling » EMF » Eopposite(navigating relationships by reference without eOpposite if it's possible)
|
Re: Eopposite [message #492362 is a reply to message #492350] |
Tue, 20 October 2009 08:39 |
Ed Merks Messages: 33113 Registered: July 2009 |
Senior Member |
|
|
Carlos,
Comments below.
Carlos wrote:
> Hi.
>
> I have a model in several files which are related by some
> relationships between some entities.
> I have defined some bidirectional relations using eopposite, and I can
> navigate that relations in both senses.
> The problem is that when I change one of that relationships that point
> out by reference a entity of the other module, there will be changes
> in both modules updating the bidirectional relationship: in the source
> module, and also in the target module.
That should be expected.
> In this case, one of that modules is read only, and therefore, that
> bidirectional relationships, can not be updated.
A consistent bidirectional reference updated on both ends.
>
> I think that containment relationships can be navigated in both senses
> (eContainer for the reverse) but I don't know how can I navigate a
> relationship by reference without using eopposite nor bidirectional
> relations to solve the problem, if that's possible.
You'd have to use something like a CrossReferencer or a
ECrossReferenceAdapter.
>
> Have you got any suggestion about this issue?
However handy inverses might be, there are often cases where it just
doesn't make sense. For example, for EClass.eSuperTypes one might be
tempted to define an inverse eSubTypes, but that would require an EClass
to know all EClasses that derive from it, which is generally unbounded
in the real world.
>
> Thanks in advance.
> Best regards.
> Carlos.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| | | | |
Re: Eopposite [message #492661 is a reply to message #492657] |
Wed, 21 October 2009 09:49 |
Ed Merks Messages: 33113 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------070801050500090002050205
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Carlos,
Comments below.
Carlos wrote:
> Hi Ed,
>
> I have solved my problem with the utilities for cross references and
> probably, I will delete the bidirectional references of my meta-model
> to manage simple relationships. When I want to explore the model in a
> reverse viewer, I use the cross references instead the opposite
> relations, and besides, without bidirectional references, disappear
> the problem I had with several related models having only one in
> editing mode ...
>
> However, I wanted to know how can I tune a meta-model with
> bidirectional relationships for being more efficient when a model is
> loaded. I have noticed that the performance of application decrease at
> that point with huge models when contains bidirectional relationships,
> and probably I don't know what is the best ecore configuration.
Options like this might help:
/**
* Defer resolution of same document references until the end of
the document is reached.
*/
String OPTION_DEFER_IDREF_RESOLUTION = "DEFER_IDREF_RESOLUTION";
Are you using intrinsic IDs (EAttributes with isID true), extrinsic IDs
(e.g., xmi:id), or fragment paths?
>
> Thanks in advance.
> Best regards.
> Carlos.
--------------070801050500090002050205
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Carlos,<br>
<br>
Comments below.<br>
<br>
Carlos wrote:
<blockquote cite="mid:hbmksg$pmp$1@build.eclipse.org" type="cite">Hi
Ed,
<br>
<br>
I have solved my problem with the utilities for cross references and
probably, I will delete the bidirectional references of my meta-model
to manage simple relationships. When I want to explore the model in a
reverse viewer, I use the cross references instead the opposite
relations, and besides, without bidirectional references, disappear the
problem I had with several related models having only one in editing
mode ...
<br>
<br>
However, I wanted to know how can I tune a meta-model with
bidirectional relationships for being more efficient when a model is
loaded. I have noticed that the performance of application decrease at
that point with huge models when contains bidirectional relationships,
and probably I don't know what is the best ecore configuration.
<br>
</blockquote>
Options like this might help:<br>
<blockquote> /**<br>
* Defer resolution of same document references until the end of the
document is reached.<br>
*/<br>
String OPTION_DEFER_IDREF_RESOLUTION = "DEFER_IDREF_RESOLUTION";<br>
</blockquote>
Are you using intrinsic IDs (EAttributes with isID true), extrinsic IDs
(e.g., xmi:id), or fragment paths?<br>
<blockquote cite="mid:hbmksg$pmp$1@build.eclipse.org" type="cite"><br>
Thanks in advance.
<br>
Best regards.
<br>
Carlos.
<br>
</blockquote>
</body>
</html>
--------------070801050500090002050205--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| |
Goto Forum:
Current Time: Thu Mar 28 17:07:06 GMT 2024
Powered by FUDForum. Page generated in 0.05468 seconds
|