|
|
|
Re: [Ecore] Does EMF has some utility in ecore to store referred EClass(s) [message #423188 is a reply to message #423187] |
Wed, 24 September 2008 14:53 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Wang,
Comments below.
Wang Liang wrote:
> I'm sorry for my wrong representation. The following is the correct.
>
> ------------------------------------------------------------ ---------------
>
>
> Assuming EClass A has a reference to EClass B, this reference is lower
> bound is 1 and upper bound is unbounded(like *). It looks like
> A--(1....*)-->B, right?
Yes.
>
> However, if we want to represent it at runtime of a model, we need to
> represent (1....*), especially ecore model itself. So, my question is
> whether ecore has some runtime implementation like one referred many?
There's a whole hierarchy of classes for representing any reference
whose upper bound is something other that 1. EObjectEList is the root
of that hierarchy. Things like the lower bound are not absolutely
enforced; clearly a list will start empty and if you want to clear a
list so that it's empty again, you're allowed to do that regardless of
the lower bound. But if you invoke Diagnostician.INSTANCE.validate, it
will complain if the list's size isn't 1 or more.
And of course you can use
XyzPackage.Literals.A__B.getUpperBound/getLowerBound to determine at
runtime the bounds on the B feature of A...
>
> Thanks.
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03064 seconds