Forum OpenACS Q&A: Objects are only part of a possible solution!

Posted by Titus Brown on
I have to agree with everyone who says that objects aren't the whole
solution, or even a necessary part of the solution.  OTOH, objects can be pretty useful.  As an example of something that's relatively simple and straightforward, consider:

One very nice feature of Zope is what is called "Acquisition":


(thanks to Jimmie Houchin for the links, which were posted to the PyWX mailing list)

The basic idea seems to be that a generic Zope object will take properties from its position in a hierarchy.  That is, if you defined a particular security requirement for /admin/, and not for /bboard/, objects that know how to talk to Zope will be able to pull that requirement out.  This is a bit more general than filters (albeit more mysterious), because you can e.g. re-root trees, or have different display properties (coloring etc.) depending on where things are, and it will all just work.

On the other hand, I suspect that much of the complexity of Zope comes from requiring people to fit the Zope paradigm, which is something that the ACS does not do.  So, I think the ACS is in general going to be less complex to extend, esp. for small extensions.  And I think that Zope, by focusing on a (badly documented) complex hierarchy of objects, is going the wrong way, certainly for me.

A final note on ACS vs. AOLserver -- Zope serves as a Web server and an application server, although it's primarily built to be an application server as I understand it.  AOLserver is a Web server, and ACS combines data and presentation, while PyWX is just a language extension.  So, Zope/ACS interaccessibility in PyWX would just be through standard language mechanisms (i.e. a set of data-model wrapper classes for Zope to access ACS data).  Since the ACS has quite a bit more functionality than Zope, it seems likely that most of the interconnection would go that way.

But I don't know for sure, and won't until I understand Zope, which may take some time ;).

cheers, titus

P.S.  Yes, I know you can do something similar to acquisition very
easily with 30 lines of Tcl code -- but that 30 lines would have to be explicitly called from every Tcl file, which has its own benefits and problems.  It's a nice abstraction, the way it's done in Zope.  That's all.