[Zope] Good Object-Oriented Design Approaches For Zope Development?

Terry Hancock hancock at anansispaceworks.com
Fri May 21 02:21:16 EDT 2004


On Thursday 20 May 2004 10:19 pm, Allan Miller wrote:
> The applications and Products I've seen define one or two application or 
> Product classes, and consist of a lot of ZPT's that are essentially forms 
> paired with, or posting to, PythonScripts.  I wonder - am I missing 
> something?  It seems like the applications are organized almost exclusively 
> around ZPT's and PythonScripts, with no use of business objects/classes, for 
> example.  Is this the unusual approach?  

I think you'll find it's fairly common for products that started life as
ad-hoc collections of scripts created using the "through-the-web"=TTW
interface.  And because that's pretty easy, it wouldn't surprise me to
find a lot of them.  But there are certainly some very popular products
that use OO design.  And Zope itself is very OO.

> Can anyone point me towards some 
> applications that are considered well designed - make good use of programmer 
> defined (espcially domain) classes?  How about some articles on  good Zope 
> application design practices?

Please understand that I'm probably at least as clueless about Java
as you are about Python. ;-)  So I'm not sure I totally follow you -- there
are somewhat different object-oriented design philosophies that prevail
in the Python community compared to the Java community.  And some terminology
doesn't translate well.

In Python you'll find that objects (specifically "class instances") are
sometimes used where you would probably use a class in Java.  There's
less distinction between the two in Python, since objects can dynamically
add and remove methods and attributes.  The "Interface" concept has been
introduced into Zope and is used to fill the role of what you might call
an "abstract class".

I don't know about "considered well designed", but my VarImage product

(SF download available from: http://sourceforge.net/projects/narya-project )

is a fairly small example of an object-oriented Zope product (at least it's
more OO than your description of products you've seen).  It also demonstrates
a simple form of component architecture to handle operator plugins -- kind
of an experiment I used to teach myself the concept, actually.

There's also the "poll" example in the ZDG and some other tutorial products
that demonstrate the general approach I've used.

(Narya itself is a much larger OO product, but as it's not yet functional,
I wouldn't recommend it as an example -- too many broken things).

No doubt other people can find other examples of OO product design.  You
will of course, want to check out the products that come bundled with
Zope -- I suspect most of those would qualify, too.

Cheers,
Terry

--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks  http://www.anansispaceworks.com




More information about the Zope mailing list