Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362784 - KDMEntity attributes should be EOperations instead
Summary: KDMEntity attributes should be EOperations instead
Status: NEW
Alias: None
Product: MoDisco
Classification: Modeling
Component: Technologies (show other bugs)
Version: 0.9.1   Edit
Hardware: PC Windows 7
: P5 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-03 08:19 EDT by Christian Wulf CLA
Modified: 2012-12-19 08:32 EST (History)
1 user (show)

See Also:
gdupe: kepler+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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