initialize methods... when do they get called?

Bob Arning arning at charm.net
Mon Jan 27 03:08:53 CET 2003


On Sun, 26 Jan 2003 17:56:04 -0800 Derek Brans <brans at nerdonawire.com> =
wrote:
>Does instance>>initialize get called anytime an instance is created?  =
Is=20
>it guaranteed?  Should I override "new" on the class side to say =
super=20
>new initialize?

Depends on the class. Morph does this already, so any subclass (unless =
you make changes to defeat this) will also do an #initialize as a part =
of #new. For other classes, you may need to do something similar =
yourself.

>When does class>>initialize get called?

The only "automatic" time is when filing out a class #initialize =
method, a doit is normally included that sends #initialize to the class =
after filing in. Other than that, it's up to you to decide when you =
need to call it.

Cheers,
Bob


More information about the Squeak-dev mailing list

Squeak-dev list courtesy of The InternetOne and tric, the new way