Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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] Wed, 24 September 2008 02:00 Go to next message
Wang Liang is currently offline Wang LiangFriend
Messages: 5
Registered: July 2009
Junior Member
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 11:32 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
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.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
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 14:39 Go to previous messageGo to next message
Wang Liang is currently offline Wang LiangFriend
Messages: 5
Registered: July 2009
Junior Member
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 14:53 Go to previous message
Ed Merks is currently offline Ed MerksFriend
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/
Previous Topic:Newbie EMF question
Next Topic:[Databinding] Generic visualization of EObjects
Goto Forum:
  


Current Time: Thu Apr 25 05:08:44 GMT 2024

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

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

Back to the top