Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Attribute vs Containment Reference Relationship
Attribute vs Containment Reference Relationship [message #1743205] Tue, 13 September 2016 09:55 Go to next message
Bugra M. Yildiz is currently offline Bugra M. YildizFriend
Messages: 106
Registered: July 2014
Senior Member
I wish to learn what is the practical difference between EAttribute and EReference that is a containment.

Thank you.
Re: Attribute vs Containment Reference Relationship [message #1743208 is a reply to message #1743205] Tue, 13 September 2016 10:10 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31900
Registered: July 2009
Senior Member
Of course they're both EStructuralFeatures. But the type of an EAttribute must be an EDataType and the type of an EReference must be an EClass. In terms of the structure that's produced from the model, instances of EDataTypes are leaf values in the structure; the value cannot be inspected further using EMF reflection. To be EDataType.serializeable, it must be possible to convert the value to a string representation for which it's possible to produce the original value (or one equal to it). Instances of EClasses are necessarily EObjects. EObjects form a graph of interconnected information than can be inspected using EMF reflection (EObject.eGet). EReferences that are containment references induce a tree (recursively EObject.eContents); container references (EObject.eContainer) are the reverse direction of that tree. EReferences that are cross references (not containment and not container) are cross links (EObject.eCrossReferences) between the nodes in the tree.

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Explain ItemProviderAdapter.getTypeText implementation
Next Topic:EOpposite
Goto Forum:
  


Current Time: Sat Jun 12 18:31:42 GMT 2021

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

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

Back to the top