I found this code but I am wondering why not use #respondsTo:
Keith
====
validate: className has: selector
(Smalltalk hasClassNamed: className) ifFalse: [ "No validation needed" ^ self ]. ((Smalltalk at: className) basicNew perform: selector) ifFalse: [ MaObjectSerializationUserError signal: 'Need to implement ', selector, ' on ', className ]
____________________________________________________
Yahoo! Photos is now offering a quality print service from just 7p a photo. http://uk.photos.yahoo.com
It's not testing respondsTo:. Its testing that the Magma programmer remembered to *override* #maWantsPreSerialization or #maWantsPostMaterialization to answer true.
I must admit I care much for the implementation, but this is just a validation-check during initialization of your system, not something called over and over. Nevertheless, if anyone has any ideas of a better way I'm open..
- Chris
--- keith hodges keith.hodges@warwick.ac.uk wrote:
I found this code but I am wondering why not use #respondsTo:
Keith
====
validate: className has: selector
(Smalltalk hasClassNamed: className) ifFalse: [ "No validation
needed" ^ self ]. ((Smalltalk at: className) basicNew perform: selector) ifFalse: [ MaObjectSerializationUserError signal: 'Need to implement ', selector, ' on ', className ]
____________________________________________________
Yahoo! Photos is now offering a quality print service from just 7p a photo. http://uk.photos.yahoo.com _______________________________________________ Magma mailing list Magma@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma
magma@lists.squeakfoundation.org