Changing attribute behavior in subclasses [message #687337] |
Tue, 31 May 2011 20:04 |
Alain Picard Messages: 266 Registered: July 2009 |
Senior Member |
|
|
What is the best way of changing the behavior of an attribute in a
sub-class.
Let's take an easy and common example with EMF itself. EMF defines a
ENamedElement that has a "name" attribute. Now let's imagine that some
of its subclasses need this name to be marked as required and others
don't. Since the behavior is not universal, we can't mark the attribute
as "required" at the level of ENamedElement, but how could we then mark
it as "required" for let's say, EClass.
We can surely have a validation, probably OCL to check this, but this
doesn't make it a formal definition according to our meta-model. Here we
would like EEF to read this "value" and make our field bold since it is
required (w/o any other manual intervention and at the model level for
validation).
Thanks for providing me some insight.
Alain
|
|
|
Powered by
FUDForum. Page generated in 0.03238 seconds