Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Difference in treating redfinded properties
Difference in treating redfinded properties [message #627081] Fri, 24 October 2008 13:05
Eclipse UserFriend
Originally posted by:

Hey again,

after being happy to understand and to apply the Union/Subsets-mechanism to
an EMF-model, i was playing a little bit with the Redefinition mechanism.
I've explored two different behaviors, that depend on the cardinality of the
redefined element, and i don't know, whether this behavior is correct.

Let's display an example:

A : Element
+ refB : B [0..*]

A2 : A
+refBB : BB[1]


In this constellation, the class A2Impl gets an Operation like getRefB()
that return an UnmodifiableEList. In the Editor, it is not possible to add
an element into this list. This is of course the correct behavior, the
reference refB was redefined in A2 to ref BB and therefore the property refB
logically didn't exist in class A2. Physically it is not possible to remove
an attribute by inheritance.

But if i change the model of A2 to this one

A2 : A
+refBB : BB [0..*]

the gefRefBBs() method looks like this:

public EList<C> getRefToBs() {
EList<BB> redefToBB = (EList<BB>)((EList<?>)getRedefToBBs());
return refBB;

and it is possible to add an element BB to the redefined property. In fact,
the result will be pushed back into the redfined list refBBs, but i would
expect, that accessing an redefined property by adding something, would
cause everytime an exception. As is mentioned, logically, the redefined
property from the parent class doesn't exist in the subclass, or am I

Hope i expressed my question clearly.

Previous Topic:Difference in treating redfinded properties
Next Topic:Missing property in UML::Class::Kernel::PackageableElement
Goto Forum:

Current Time: Sat Aug 13 03:44:56 GMT 2022

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

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

Back to the top