Posted on 21 Sep 1999
by Daniel Cody (djc)
Rated 3.83 (Ratings: 4)
- More articles in Backend
I want to explain better what Zope is - it really is a *very* differentway of thinking about web programming and web publishing. The trickwith zope is understanding just what it's all about in the first place. I think it's going to still come off kind of abstract, but I'll try togive some concrete examples and drive it down to the real worldeventually.
My first thought was "oh, a web based publishing environment withdatabase ties - interesting". But that's really giving it a seriouslyshort shrift.
Zope is much more like a Smalltalk(pure OO) environment that is tightlybound (inextricably wedded) to the web (http), complete with all the OOPessentials: encapsulation, inheritance, and polymorphism. All of thenative objects live in a multi-threaded, multi-user object database. The object database is *not* a relational database backend - it's a realobject database with oids and optimistic locking and all that. Zopealso has facilities called "database adapters" which allow you toexploit an elegant (nearly transparent) object to relational mappingmechanism.
Within all that is an authentication/authorization system. Users haveroles. All non-user objects in the system have permissions, which mapto roles (which are infinitely definable). Permission to role mappingscan selectively be inherited from parent objects or defined at the levelof any given object regardless of parent mappings. So the granularityof authorization is extremely fine (if you want it to be).
The authentication system by default relies on user objects that aredefined in the object database. But since the authentication system isa component like anything else, it's possible to install alternativesystems that authenticate off of other sources, like relationaldatabases or flatfiles or LDAP servers or IMAP servers. Depending onthe capabilities of the authentication backend, you can actually have asmuch flexibility with them as you can with the native system (rolesetc). LDAP would allow this for example.
The eventual goal of all that is to let you create dynamic (and static)web content.
"Publishing" in the zope environment is 100% web based - you will**NEVER** be at a command prompt - all interaction with Zope occursthrough http or ftp (primarily http).
The most basic type of publishing is the familiar "create content withyour local HTML WYSIWYG editor and publish with http PUT or ftp" thing. From the perspective of http PUT and ftp, Zope's object environmentappears to be a filesystem of the ordinary sort, and your content showsup as expected.
When you publish to zope in this way, you take advantage of the two mostbasic types of "products" (roughly "classes", but they're more involvedthan that): "Folders" and "DTML Documents". These will be generated foryou automatically.
If you choose to work directly with Zope via it's web interface, you'llwork more directly with "products" and you'll have a much wider varietyof them at your disposal (plus you can create new ones, package them up,and distribute them).
The key to dynamic publishing in Zope is it's "DTML" language. DTML isa superset of html that ties tightly with the object database and theO-R mapping mechanism. The genius of it lies in it's layering ofnamespaces as relates to your current context - and the fact that all of*that* maps to http (read: URLS) automatically.
PHP is just a scripting language - really leagues away from what Zope is(PHP is closer to Perl w/extensions than it is to Zope).
To really figure it out, you have to work with it. If people are reallyinterested we can do a demo (I'd be glad to do it). Otherwise, get anaccount at http://www.zope.org or set one up yourself and play with it. The more you use it, the more you find.