Magritte Validation Error

Ramon Leon rleon at insario.com
Mon Nov 28 16:50:53 MET 2005


No, it is the call to isKindOf from the super class that is failing, the call to includes works fine.  My project class does implement #= and hash, and uses a UUID string for identity.  self kind is resolving to Class class, since isKindOf is being sent to anObject, that should resolve the proxy, so perhaps something is wrong with:
 
descriptionProject
    ^(MASingleOptionDescription selector: #project label: 'Project' priority: 10)
        reference: MAClassDescription new;
        options: (MADynamicObject on: [ TMProject repository asArray]);
        beRequired; beSorted ;
        yourself
 
MAClassDescription seems wrong, looking now, I see why isKindOf is failing, I'm not filling the dropdown with classes, but I don't see what's appropriate, without it I get MessageNotUnderstood: TMProject>>do:.  So how do I use other domain objects in a SingleOptionDescription rather than just a simple list of symbols or strings?

________________________________

From: owner-smallwiki at iam.unibe.ch on behalf of Lukas Renggli
Sent: Mon 11/28/2005 5:41 AM
To: smallwiki at iam.unibe.ch
Subject: Re: Magritte Validation Error



> into MADescription and commented out the code for validateKind: 
> anObject.  Turns out that fixed my issue.  Validation was failing 
> because the objects I had in a single option description were 
> proxies coming from goods, and they fail validateKind:, has someone 
> else run into this?  Guess I'll just leave it commented out for now 
> until there's a fix, or I figure out what I'm doing wrong.

The method #validateKind: for MASingleOptionDescription look like (I 
merged in the super-call):

MASingleDescription>>validateKind: anObject
        (anObject isKindOf: self kind)
                ifFalse: [ MAKindError on: self ].
        (self isExtensible or: [ self options includes: anObject ])
                ifFalse: [ MAKindError on: self ].

anObject is used as a receiver for #isKindOf: and #= within 
#includes:. I think the #isKindOf: should resolve any proxies, but 
there is probably a problem with the #includes:.

I think the point is that your project-class doesn't implement #= and 
therefor defaults to #==, so you the #includes: identity-compares 
every project with the proxy ... what fails of course.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch <http://www.lukas-renggli.ch> 



-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 5974 bytes
Desc: not available
Url : http://www.iam.unibe.ch/pipermail/smallwiki/attachments/20051128/3cdd9d08/attachment.bin


More information about the SmallWiki mailing list