[Zope-dev] ComponentArchitecture thoughts

Joachim Werner joe@iuveno-net.de
Sat, 4 Aug 2001 22:17:01 +0200


Hi!

> Some points on this: I may have a biased opinion, but I find ZClasses of
> limited utility.  Yes they're easy, but I think that's just because the
> Python alternative is too hard (which is what components try to
> address).

I agree that ZClasses are harder to learn and use than necessary. And after
reading the new developers guide, I think that even now working with Python
Products is not too hard. Setting up a simple content object with Python is
easy (basically, use SimpleItem and add some properties and management
screens). But there are three things that make ZClasses partly more powerful
than Python products:

a) they are "over-the-web"
b) code changes are reflected in the product immediately
c) they behave like "prototypes" or "templates" of complex objects; like
folders,
    they can contain arbitrary Zope objects and make them available to all
their instances

a) and b) are gradually becoming less important. If you combine the refresh
capabilities of Zope 2.4 with Stephan Richter's "Product View" product, you
can do most of your coding over the web like in ZClasses. Yes, that's all
very experimental, but the proof-of-concept is there.

c) is much harder to do because in Python products I can either have methods
defined in code or copied to/created in the instances, but nothing
comparable to the ZClasses' way of putting stuff into a folder.

> Re-doing ZClasses or something like them will be much easier following
> the component model.

Probably ;-)

> On the side, keep in mind that the component model will simplify
> security for the developer quite a bit.  By cleanly separating
> presentation from application from content, you can assess the security
> needs for each layer independently.  Right now, different methods that
> you want to protect under different policies are all mushed into one
> class, which is why you *need* to be very verbose with security now.
> Decomposing that will let you secure your components in bite sized
> chunks.

That's not completely true ;-) I mean you already can factor out parts of a
class into support classes. That's why, If I got it right, most of the magic
of components is not new code, but just new coding style, yes?

Joachim