|
Re: Building a Bidirectional Containment Map [message #1145064 is a reply to message #1144167] |
Sat, 19 October 2013 08:18 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Ken,
Given a Person p, p.eContainer() is map entry and
p.eContainer().eContainer() is the container of that map entry, in your
case, it will be a Bus. It seems to me though that likely you should
just have Bus contain Person and you just want so convenient looked
operation to find a Person by name, and perhaps it's important that it
be really fast, so perhaps you want to build a map/cache, but building a
cache introduces the problem of how to manage its consistency with
respect to the Persons of the Bus and with respect to the name of each
Person, both of which can change...
On 18/10/2013 7:55 PM, Ken Keefe wrote:
> I'm trying to create a map that contains the values and also provides
> a bidirectional reference for the values back to the object that
> contains the map. Hopefully, EMF can take care of managing the
> bidirectional references for me. I've done a lot of googling and have
> had no luck. I started writing a tutorial in order to work through the
> problem. Please take a look at the tutorial, which is short, and
> comment if you know how to solve the last part.
> You can download the example project from the tutorial page.
>
> https://www.perform.csl.illinois.edu/~kjkeefe/?p=135
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02852 seconds