On Mon, 2002-11-18 at 16:58, Stuart Donaldson wrote:
> It looks like the MixIn approach would work, but it doesn't feel like a good
> solution.  Perhaps I just don't have enough of the python religion, but it
> feels like this kind of solution should be reserved for extreme cases.  
> 
> The well designed solution seems to encourage the approach of overriding the
> methods through subclassing.  This works better for documentation tools, and
> just plain old following the code.  The idea of the MixIn is pretty cool for
> cases where subclassing can't be implemented.  But in the case of Webware,
> we have control over the modules in question, and the design of the rest of
> the system seems to support subclassing.

It's not so much a Python thing.  I originally thought subclassing would
be best, but I realized that they it can be awkward in some ways.

If you want to use local subclassing you could always just change the
import statement to use your local subclass.  This won't be entirely
seemless for upgrading, but I don't think that's a big problem.  Of
course, you couldn't easily distribute the enhanced class -- but I think
that's a problem anyway with subclassing.  You can distribute a
subclassing of a single class, but that doesn't leave a good way to use
two customizations (even though they might not otherwise conflict).

Even if it seems kind of weird, I think the mixin approach solves most
of these -- if you make your customization into a plug-in, it can change
the classes when its initialized.  This should make it easy to
distribute customizations.

> BTW - Should this type of discussion actually be taking on the webware-dev
> list, rather than the webware-discuss list?  webware-dev doesn't seem to get
> into much technical details, and I'm wondering if we're just sort of
> defaulting to using webware-discuss?

I dunno... everyone who uses Webware is a developer, after all, so it's
a vague distinction.  But I suppose since we're talking about changes to
Webware itself it's a -devel sort of discussion... just a slightly
smaller group of readers.

  Ian



-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to