[Seaside-dev] basicNew

Avi Bryant avi at dabbledb.com
Mon Sep 29 19:41:30 UTC 2008


On Mon, Sep 29, 2008 at 11:32 AM, Randal L. Schwartz
<merlyn at stonehenge.com> wrote:
>>>>>> "Avi" == Avi Bryant <avi at dabbledb.com> writes:
>
> Avi> initializeWithX: xNumber y: yNumber
> Avi>   super initialize.
> Avi>   x := xNumber.
> Avi>   y := yNumber.
>
> It's bad form to use "super" with a method name that isn't your own.  In fact,
> I think it's an error that Smalltalk allows you to do it.  It breaks
> subclassing, because there's *no way* a subclass could ever override that
> "initialize" method now.
>
> Change "super" to "self" in this method, and I'd be happy.  If the current
> class has no initialize, it's the same execution flow.

Change super to self in this method, and (given the rest of the code
in my example) you would have infinite recursion.

It may be bad form in general, but this is a very specific and
controlled convention and as long as you follow it, I'm pretty sure it
does work out (in terms of being able to override what you want to
override).  If you're concerned about what happens in specific
subclassing situations, can you give an example?  I'd love to explore
this in a little more depth and make sure it does actually work.

Avi


More information about the seaside-dev mailing list