Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [EMF.core] EObjectValidator does not support multiple inheritance validation
[EMF.core] EObjectValidator does not support multiple inheritance validation [message #716712] Thu, 18 August 2011 03:22 Go to next message
Ed Willink is currently offline Ed Willink
Messages: 3840
Registered: July 2009
Senior Member
Hi

In

EObjectValidator.validate(EClass eClass, EObject eObject,
DiagnosticChain diagnostics, Map<Object, Object> context)

the recursion (for non-EcorePackage) to superclass is via

validate(eSuperTypes.get(0), eObject, diagnostics,
context);

rather than a loop over all eSuperTypes, so constraints inherited from a
second supertype are ignored.

Is this deliberate or an oversight? It's certainly a convenient way of
avoiding double validation of a constraint
inherited from more than one superclass.

Regards

Ed Willink
Re: [EMF.core] EObjectValidator does not support multiple inheritance validation [message #716887 is a reply to message #716712] Thu, 18 August 2011 13:15 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25740
Registered: July 2009
Senior Member
Ed,

I suppose, it's the best we can do when an appropriately dispatching
generated validator isn't produced. You can think of it as similar to
not being able to extend two different generated classes dynamically.
However, Kenn added support for delegates later in the evolution, and
it's a bit more problematic from that angle, i.e., in the fully dynamic
case, you'd hope all the constraints from all the supers would be
considered. I'll ask Kenn to comment...


On 18/08/2011 12:22 AM, Ed Willink wrote:
> Hi
>
> In
>
> EObjectValidator.validate(EClass eClass, EObject eObject,
> DiagnosticChain diagnostics, Map<Object, Object> context)
>
> the recursion (for non-EcorePackage) to superclass is via
>
> validate(eSuperTypes.get(0), eObject, diagnostics,
> context);
>
> rather than a loop over all eSuperTypes, so constraints inherited from
> a second supertype are ignored.
>
> Is this deliberate or an oversight? It's certainly a convenient way of
> avoiding double validation of a constraint
> inherited from more than one superclass.
>
> Regards
>
> Ed Willink
>
Re: [EMF.core] EObjectValidator does not support multiple inheritance validation [message #717024 is a reply to message #716887] Fri, 19 August 2011 01:20 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 3840
Registered: July 2009
Senior Member
Hi

https://bugs.eclipse.org/bugs/show_bug.cgi?id=355184 raised to better
persist comments.

Regards

Ed Willink

On 18/08/2011 18:15, Ed Merks wrote:
> Ed,
>
> I suppose, it's the best we can do when an appropriately dispatching
> generated validator isn't produced. You can think of it as similar to
> not being able to extend two different generated classes dynamically.
> However, Kenn added support for delegates later in the evolution, and
> it's a bit more problematic from that angle, i.e., in the fully
> dynamic case, you'd hope all the constraints from all the supers would
> be considered. I'll ask Kenn to comment...
>
>
> On 18/08/2011 12:22 AM, Ed Willink wrote:
>> Hi
>>
>> In
>>
>> EObjectValidator.validate(EClass eClass, EObject eObject,
>> DiagnosticChain diagnostics, Map<Object, Object> context)
>>
>> the recursion (for non-EcorePackage) to superclass is via
>>
>> validate(eSuperTypes.get(0), eObject, diagnostics,
>> context);
>>
>> rather than a loop over all eSuperTypes, so constraints inherited
>> from a second supertype are ignored.
>>
>> Is this deliberate or an oversight? It's certainly a convenient way
>> of avoiding double validation of a constraint
>> inherited from more than one superclass.
>>
>> Regards
>>
>> Ed Willink
>>
Previous Topic:Set attribute of EMap, EEList
Next Topic:[Resolved] Import emf model in another
Goto Forum:
  


Current Time: Wed Apr 16 18:48:35 EDT 2014

Powered by FUDForum. Page generated in 0.01460 seconds