[Zope] Death to zClasses! (or zClasses are great! Except when they aren't)

Steve Spicklemire steve@spvi.com
Thu, 6 Jun 2002 01:31:12 -0500


Hi ZClass Bashers, ;-)

I know I'm coming late to this roast... and I basically agree with all 
of Max's points, at *some* level. However.. I think that while ZClasses 
may have missed the mark on some points, and will never be a great 
answer for "serious" developers working on complex stuff (requiring 
fancy class hierarchies), for certain purposes they have a lot to 
recommend them.

Generally, when I start working on a filesystem based Zope Product, 
there's a lot of housekeeping to do before I can really get started with 
the "meat" of the project. The way I "normally" do it, is to take some 
other product I've written, rename a bunch of stuff, throw a bunch of 
stuff out, and hope I've got it all right. ;-) The good news is, that if 
I don't have it all right... I can just change it, and everything is 
still OK. But it takes a lot of time, and a lot of fiddling around. If 
what I need is basically a very simple class, with some "standard" 
property types, and some simple methods, a ZClass is a very quick and 
painless way to get there in 5 minutes. I think of ZClasses as a sort of 
RAD tool to break into something quickly and try out some ideas. Maybe 
the project will never need anything more. If it does, I refactor and go 
the filesystem based Product route, but probably *after* I've learned a 
lot about the problem(s) and have some clear idea of how to avoid any 
pitfalls I've discovered. If you mix this kind of thinking with 
ZPatterns, then it's even cleaner, since the application is really tied 
together in instance space (Racks and Specialists) and the low level 
classes don't generally handle any inter-object collaboration (i.e., you 
don't need fancy subclasses of other zope objects since the only classes 
you're actually *writing* are SimpleItemish things). At this point with 
various tricks and templates, I can cook up a fairly fancy 
ZPatterns/ZClass based application with five or six different classes 
all collaborating and doing fairly fancy stuff (e.g., backed by a 
relational database, or ZCatalog) in a day or so (no UI, just 
connections and problem domain stuff). If I were doing the same thing 
with all filesystem based products/classes, it would probably take me 
three times as long (rough guess).

Anyway.. I just thought ZClasses didn't deserve quite the degree of 
disrespect that I've been hearing, since *I* have at least been grateful 
for their existence, even if I have cursed them occasionally when I 
tried to push them further than they could reasonably go. Just because 
you can't build a skyscraper with a pocketknife, it doesn't mean that 
they're not handy to have when you need one.

;-)

enjoy,
-steve

On Wednesday, May 29, 2002, at 01:45  AM, Chris Withers wrote:

> Casey Duncan wrote:
>>
>> You make good points. I would recommend putting this somewhere more 
>> permanent,
>> such as a page on Zope.org.
>
> How about the front page of zope.org? *weg*
>
> Chris
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )