Skip to main content



      Home
Home » Modeling » EMF » [Ecore] Does EMF has some utility in ecore to store referred EClass(s)
[Ecore] Does EMF has some utility in ecore to store referred EClass(s) [message #423162] Tue, 23 September 2008 22:00 Go to next message
Eclipse UserFriend
If I want to store referred EClass(s) of a EReference, does EMF provides
such utility to implement this? Or, it needs to be implemented by myself.

Thanks.
Re: [Ecore] Does EMF has some utility in ecore to store referred EClass(s) [message #423175 is a reply to message #423162] Wed, 24 September 2008 07:32 Go to previous messageGo to next message
Eclipse UserFriend
Wang,

An EClass is just an EObject so a reference to one works just like any
other reference...


Wang Liang wrote:
> If I want to store referred EClass(s) of a EReference, does EMF
> provides such utility to implement this? Or, it needs to be
> implemented by myself.
>
> Thanks.
>
Re: [Ecore] Does EMF has some utility in ecore to store referred EClass(s) [message #423187 is a reply to message #423175] Wed, 24 September 2008 10:39 Go to previous messageGo to next message
Eclipse UserFriend
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?

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?

Thanks.
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 10:53 Go to previous message
Eclipse UserFriend
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.
>
Previous Topic:Newbie EMF question
Next Topic:[Databinding] Generic visualization of EObjects
Goto Forum:
  


Current Time: Wed Jul 23 16:43:28 EDT 2025

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

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

Back to the top