About KCP and automatic initialize

Ned Konz ned at bike-nomad.com
Mon Sep 15 15:18:10 UTC 2003


On Monday 15 September 2003 02:20 am, Noury Bouraqadi wrote:
> Sorry, but its part of the Smalltalk conventions to make new send
> initialize (see the Kent Beck book about Smalltalk best practice
> patterns).

Where did Kent say that?

I do see (under Constructor Method, p. 23):

The most flexible way to represent instance creation is by a simple 
"new" method, followed by a series of messages from the client to the 
new instance. That way, if there are different combinations of 
parameters that make sense, the client can take advantage of just 
those parameters it needs.

[ followed by a discussion of why that's hard to figure out when 
reading]

The alternative is to make sure that there is a method to represent 
each valid way to create an instance. Does this result in a 
proliferation of instance creation methods? Almost never. Most 
classes only have a single way to create an instance. Almost all of 
the exceptions only have a handful of variations.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list