[Seaside-dev] basicNew

Julian Fitzell jfitzell at gmail.com
Sat Oct 4 22:51:10 UTC 2008


On Sat, Oct 4, 2008 at 11:49 PM, Philippe Marschall
<philippe.marschall at gmail.com> wrote:
> 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 guess calling new instead of basicNew and not call #initialize from
>> #initializeWithBar: also works, but means you don't have control over
>> when (or if) #initialize gets called.  I have to admit that the whole
>> initialization pattern feels a bit ugly both ways though. Is this the
>> preferred pattern throughout now?
>
> So after all this talk, what is the conclusion? I really think that anything that subclasses WAObject absolutely must receive #initialize or else it should subclass Object. I can live with anything that satisfies this and would prefer to have it applied uniformly.
>
> Since Lukas and Julian wrote a lot of code in question (I just stumbled upon WACachePlugin) what is your opinion?

I absolutely agree that #initialize must be called and it was a bug on
my part not to do so.

I also don't really care what pattern we use as long as it is
consistent. Avi's description sounded pretty sane to me but I was
hoping to hear Randal's response.

Julian


More information about the seaside-dev mailing list