Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Reflective feature delegation works incorrectly
Reflective feature delegation works incorrectly [message #478033] Thu, 27 November 2008 12:19 Go to next message
Rimvydas is currently offline RimvydasFriend
Messages: 47
Registered: July 2009
Member
Hello,

Suppose I have a model:
1) classes A, B and C
2) B and C are derived from A
3) A class has a property allElements of type A (derived union, ordered,
multiplicity: 0..*)
4) B class has a property cElements of type C (ordered, multiplicity:
0..*), subsetted property A.allElements

If I generate a code using genmodel property Feature delegation: none then
generated method getAllElements in class A returns object
DerivedUnionEObjectEList and the model works correctly. E.g.:
B b = DataFactory.eINSTANCE.createB();
C c = DataFactory.eINSTANCE.createC();
b.getCElements().add(c);
System.out.println("c element count: " + b.getCElements().size());
System.out.println("all element count: " + b.getAllElements().size());

c element count and all element count is equal to 1.

But if I change genmodel property to Feature delegation: Reflective then
the code above will return:
c element count: 1
all element count: 0

My question:
Is it possible to configure genmodel that it would generate correct
implementation then Feature delegation property value is Reflective? If
yes then how?
Re: Reflective feature delegation works incorrectly [message #478036 is a reply to message #478033] Mon, 01 December 2008 14:43 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Rimvydas,

This is a bug. The code to support derived unions is not being generated if
reflective feature delegation is used, and it probably should be. Please
open a Bugzilla report and we'll look into it.

Kenn

"Rimvydas " <rimvydas@nomagiclt.com> wrote in message
news:299d13ec96fbc8f06101a27abed27f2b$1@www.eclipse.org...
> Hello,
>
> Suppose I have a model:
> 1) classes A, B and C
> 2) B and C are derived from A
> 3) A class has a property allElements of type A (derived union, ordered,
> multiplicity: 0..*)
> 4) B class has a property cElements of type C (ordered, multiplicity:
> 0..*), subsetted property A.allElements
>
> If I generate a code using genmodel property Feature delegation: none then
> generated method getAllElements in class A returns object
> DerivedUnionEObjectEList and the model works correctly. E.g.:
> B b = DataFactory.eINSTANCE.createB();
> C c = DataFactory.eINSTANCE.createC();
> b.getCElements().add(c);
> System.out.println("c element count: " + b.getCElements().size());
> System.out.println("all element count: " + b.getAllElements().size());
>
> c element count and all element count is equal to 1.
>
> But if I change genmodel property to Feature delegation: Reflective then
> the code above will return:
> c element count: 1
> all element count: 0
>
> My question:
> Is it possible to configure genmodel that it would generate correct
> implementation then Feature delegation property value is Reflective? If
> yes then how?
>
>
Re: Reflective feature delegation works incorrectly [message #627253 is a reply to message #478033] Mon, 01 December 2008 14:43 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Rimvydas,

This is a bug. The code to support derived unions is not being generated if
reflective feature delegation is used, and it probably should be. Please
open a Bugzilla report and we'll look into it.

Kenn

"Rimvydas " <rimvydas@nomagiclt.com> wrote in message
news:299d13ec96fbc8f06101a27abed27f2b$1@www.eclipse.org...
> Hello,
>
> Suppose I have a model:
> 1) classes A, B and C
> 2) B and C are derived from A
> 3) A class has a property allElements of type A (derived union, ordered,
> multiplicity: 0..*)
> 4) B class has a property cElements of type C (ordered, multiplicity:
> 0..*), subsetted property A.allElements
>
> If I generate a code using genmodel property Feature delegation: none then
> generated method getAllElements in class A returns object
> DerivedUnionEObjectEList and the model works correctly. E.g.:
> B b = DataFactory.eINSTANCE.createB();
> C c = DataFactory.eINSTANCE.createC();
> b.getCElements().add(c);
> System.out.println("c element count: " + b.getCElements().size());
> System.out.println("all element count: " + b.getAllElements().size());
>
> c element count and all element count is equal to 1.
>
> But if I change genmodel property to Feature delegation: Reflective then
> the code above will return:
> c element count: 1
> all element count: 0
>
> My question:
> Is it possible to configure genmodel that it would generate correct
> implementation then Feature delegation property value is Reflective? If
> yes then how?
>
>
Previous Topic:Re: Getting the source code for eclipse uml2
Next Topic:Problems to patrticipate in a DerivedSubset-Association
Goto Forum:
  


Current Time: Fri Apr 19 07:58:38 GMT 2024

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

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

Back to the top