mardi 20 décembre 2005

The Why of the Zope Component Architecture

On his Griddle Noise weblog, Jeffrey Shell posted an article entitled The Zope Component Architecture - Interfaces, Adaptation, and Duck Typing. For me, this is the best "first step" for Zope 3 that I've yet seen, especially for Python programmers.

Why do I say the best? Basically, the why is "Why". This article, much better than other writeups, explains the problems that are being solved by certain technology. And the explanation isn't done in terms of other technology. It's done in terms of a recognizable problem, not a problem you don't really know about until after you've gotten a component architecture. Other explanations have somewhat of a self-referential quality that leaves me more confused than I started. Jeffrey has always been a good writer, and he's clearly enthusiastic about Zope 3.

There are two other parts that shine on this. First, he doesn't use a server. In fact, the best parts don't talk about the web at all. (Other Zope 3 guides are also good at this, putting the focus back on Python. But for some reason, Jeffrey's seems better.) Also, there is no ZCML used. Not a whiff. I don't mind editing XML, but I do mind the indirection introduced when I'm still trying to digest the first bites.

The second paragraph starts with 2 sentences that really got me thinking:

What makes all this possible? The Zope Component Architecture.

This article shows quite well that the component architecture is useful for plugging Python stuff together. It isn't just for Zope, and especially, isn't just for web applications. Later Jeffrey says:

In something purely theoretical, lets remove all of Zope as people know it (the object database, the publisher that traverses URLs to return objects, and so on and so on). Using the component architecture, let's do an extremely lightweight...

Zope is strongly associated with a certain, differentiated approach to web applications. Thus, the Zope Component Architecture must first get people to unlearn that perception, if we want it to be a general-purpose Python pattern. Articles like Jeffrey's, which strip it down, beyond just Zope and even to the point of removing the web, do a great service towards this.
11:31:18 AM   comment []