[Seaside-dev] basicNew

Philippe Marschall philippe.marschall at gmail.com
Mon Sep 29 17:50:25 UTC 2008


2008/9/29, Julian Fitzell <jfitzell at gmail.com>:
> Seaside-Core-pmm.267.mcz
> - use #new instead of #basicNew for WACallbackRegistry, using
> #basicNew has already lead to interesing bugs in other places
>
> I always thought the pattern was:
>
> Foo class>>bar: param
>   ^ self basicNew initializeWithBar: param
>
> Foo>>initializeWithBar: param
>   self initialize.
>   bar := param

I'm not aware that a pattern has been established. #initialize must be
sent somewhere for subclasses for WAObject. Either on the class side
in #new or on the instance side side in #initializeWithBar. Otherwise
code relying on #initialize being executed as guaranteed by the
contract of WAObject will fail. This is not theoretical, we already
had such a bug in Seaside. A clear convention would be helpful IMHO.

WACallbackRegistry however never sends #initialize so it's bugged IMHO.

Cheers
Philippe


More information about the seaside-dev mailing list