Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 362784

Summary: KDMEntity attributes should be EOperations instead
Product: [Modeling] MoDisco Reporter: Christian Wulf <chwchw>
Component: TechnologiesAssignee: Project Inbox <modisco.web-inbox>
Status: NEW --- QA Contact:
Severity: major    
Priority: P5 CC: gdupe
Version: 0.9.1Flags: gdupe: kepler+
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Christian Wulf CLA 2011-11-03 08:19:50 EDT
Build Identifier: 

KDMEntity has only one attribute, its name. You, however, defined all operations as attributes, too. Thus, assuming x is of type KDMEntity, x.getOwner(), for example, does not return the owner when added with y.getCodeElements().add(x). At the moment, one has to add x additionally (!) with y.getOwnedElements().add(x). So you always have to add the subsets manually to getOwnedElements which needs two times the amount of memory and can cause faults if you forget to add it to getOwnedElements addtionally.

Instead, you only need to give implementations of the operations without declaring a corresponding attribute. The operations should then, however, generically return all lists that subsets ownedElements (see the KDM Spec. for that). Unfortunately, ECore models do not support union yet, so you have to annotate the models appropriately, e.g., with method body logic for the constructor.

Reproducible: Always