Pillars of Python: Zope 2 Web framework

Zope 2 provides everything you need in one package, including the database and development environment

1 2 3 Page 3
Page 3 of 3

Acquisition is even hooked into Python's inheritance mechanism. For example, when the system attempts to resolve an attribute on an object, the inheritance hierarchy is searched first, followed by the acquisition hierarchy. Consequently, you can define a method on an object and place it in a container. From there, objects in all subcontainers will "acquire" the capabilities of that object. This can be used to make a particular service -- the ability to send email, for example -- available throughout a Zope object hierarchy.

There are basically three sorts of objects stored in a ZODB: content, presentation, and logic. Content objects abstract file system entities such as folders and files. Folder objects hold file objects or other folder objects. File objects hold data such as audio, video, text, and so on. Presentation objects correspond to the "view" component of MVC (model-view-controller) architecture; they operate on content to produce displayable data. Typically, a presentation object will be a Zope Page Template (ZPT) object. ZPT lets you embed into HTML special XML namespace elements that provide dynamic behavior to the rendered page.

Although Zope 2 has no specific JavaScript support (the Zope 2 engineers regard JavaScript as a client-side technology), JavaScript can nonetheless be served from ZODB objects.

Finally, logic objects correspond roughly to the "controller" component of MVC architecture; a logic object performs any processing that is not involved in presentation. Another name for logic objects are "Script (Python) objects," which execute a security-constrained subset of the Python language. The objects are security constrained in that there are some operations they cannot perform; for example, they cannot access files on the file system.

Zope 2 is a "batteries included" Web framework and application server -- you truly get everything you need. The ZODB object database is built in, it has no practical size limit (other than the maximum file size that the host OS can support), and it's safe from SQL injection attacks. Naturally, Zope 2's rich capability comes with additional complexity. Learning this framework will take time.

Read reviews of other Python Web frameworks:

This article, "Pillars of Python: Zope 2 Web framework," was originally published at InfoWorld.com. Follow the latest developments in application development and Python at InfoWorld.com. For the latest developments in business technology news, follow InfoWorld.com on Twitter.

Copyright © 2011 IDG Communications, Inc.

1 2 3 Page 3
Page 3 of 3
How to choose a low-code development platform