[Q] initialization pattern
ducasse at iam.unibe.ch
Sun May 16 16:13:42 UTC 2004
On 16 mai 04, at 17:36, Boris Gaertner wrote:
> With change set 5503 a new initialization pattern
> was introduced: The method Behavior>> new
> sends the message initialize to the newly created
> instance. This has some advantages (also, but not only,
> for teaching) and will hardly ever cause problems.
> Interestingly, the object creation pattern for
> variable subclasses was left unchanged: The
> method Behavíor>>new: does not send the message
> initialize to the newly created object.
Seems to me a mistake because new: should call also initialize or may
> Even more interesting, when you send new to a
> variable subclass, an instance of size 0 is
> created and initialized (methods new, basicNew and
> basicNew: cooperate to achieve this).
> I stumbled over this peculiarity when I moved
> some code to the 3.7 image.
> This is of course not a real problem, but I think
> it is a difference in behavior that causes the question
> I would be pleased to read opinions about this
> Greetings, Boris
More information about the Squeak-dev