Skip to main content


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 07:22 Go to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
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 17:15 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
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
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [EMF.core] EObjectValidator does not support multiple inheritance validation [message #717024 is a reply to message #716887] Fri, 19 August 2011 05:20 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
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: Thu Apr 25 04:40:14 GMT 2024

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

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

Back to the top