[Seaside-dev] basicNew

Randal L. Schwartz merlyn at stonehenge.com
Sun Oct 5 02:10:06 UTC 2008


>>>>> "Julian" == Julian Fitzell <jfitzell at gmail.com> writes:

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

I'm just restating the pattern I've learned from long ago, namely that
anInstance>>#initialize should call "super initialize", then add any additional
features, then return self.  And aClass>>#new should answer "self basicNew
initialize".  Any unusual constructors should start with "self new",
then do their specialization, then return the final object.  Appropriately
modified for a size parameter for indexable objects, of course.

And if you wanted any specialization to that process, you should either make
sure that subclasses can still respect the convention, or document the heck
out of your exception to the pattern.

At least, this is the way I remember it.  I might be getting too old now
though. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


More information about the seaside-dev mailing list