Fwd: [Seaside] Re: Help with converting Gardner

Avi Bryant avi.bryant at gmail.com
Sat Dec 18 15:18:12 CET 2004


On Sat, 18 Dec 2004 22:04:48 +0800, Yar Hwee Boon <hboon at motionobj.com> wrote:

> Comparing this approach of setting a pluggable data object to the current
> way of subclassing WASession, what would be the benefit of the former? In
> other words, is there anything undesirable with subclassing?

Yes, because in a single-inheritance language you can only subclass
once, whereas you can plug as many times as there are plugs.  For
example, the patterns around using GOODS with Seaside are getting
concrete enough that there should probably be a standard
WAGOODSSession.  But if you've already subclassed WASession to add
your data ivars, how can you reuse it?  You could change the
superclass of your session, but what if you want a version of your
application that does use GOODS, and one that doesn't?  But if you had
them in a separate data object, you could plug it into either a normal
WASession or a WAGOODSSession.  That's been the general motivation
behind minimizing the need for subclassing.

Avi


More information about the Seaside mailing list