You are not logged in Log in Join
You are here: Home » Zope Documentation » Books » The Zope Book Releases » The Zope Book (2.6 Edition) » Zope Concepts and Architecture

Log in
Name

Password

 
Previous Page Up one Level Next Page Zope Concepts and Architecture Comments On/Off Table of Contents

Zope Concepts and Architecture

Fundamental Zope Concepts

The Zope framework has several fundamental underlying concepts, each of which you should understand to make the most of your Zope experience.

Anonymous User - May 26, 2005 11:41 pm:
 thanks
Anonymous User - Sep. 22, 2005 10:00 am:
 this comment system is TERRIBLE.
Anonymous User - Sep. 29, 2005 7:26 am:
 agree - why is no-one moderating this?
Anonymous User - Oct. 27, 2005 10:50 am:
 NO ONE CLEANS THESE COMMENTS???THEY ARE QUITE ANOYING!!
Anonymous User - Oct. 27, 2005 10:23 pm:
 THIS COMMENT IS TOTALLY WORTHLESS!
 I PUT IT HERE TO WASTE YOUR TIME!
 THAT WAS FIVE SECONDS OF YOUR LIFE YOU WILL NEVER GET BACK!
 GREATEST DOCUMENTATION EVER

Zope Is A Framework

Zope relieves the developer of most of the onerous details of Web application development such as data persistence, data integrity and access control, allowing you to focus on the problem at hand. It allows you to utilize the services it provides to build web applications more quickly than other languages or frameworks. Zope allows you to write web application logic in the Python language, and provides add-on support for Perl. Zope also comes with two solutions that allow you to "template" text, XML, and HTML: Document Template Markup Language (DTML), and Zope Page Templates (ZPT).

Anonymous User - Apr. 13, 2005 2:13 am:
 Reading about zope cms framework
Anonymous User - May 16, 2005 12:06 pm:
 This comes as a huge surprise !
Anonymous User - Oct. 27, 2005 9:23 pm:
 有意思:)

Object Orientation

Unlike common file-based Web templating systems such as ASP or PHP, Zope is a highly "object-oriented" Web development platform. Object orientation is a concept that is shared between many different programming languages, including the Python language in which Zope is implemented. The concept of object orientation may take a little "getting-used-to" if you're an old hand at primarily procedural languages typically used for web scripting such as Perl or PHP, but you should be able to get a grasp on the concepts by reading the Object Orientation chapter and by "learning-by-doing" with respect to the examples in the book.

Anonymous User - Dec. 9, 2004 2:05 am:
 PHP and ASP are object oriented!!! You're lying!!!
Anonymous User - Dec. 13, 2004 6:43 am:
 but they are not HIGHLY "object-oriented", PHP and ASP sucks! (especially ASP!)
 you should learn a bit about OO programming
Anonymous User - Jan. 25, 2005 10:39 pm:
 that's true.. the OOP features of PHP are not worth to be called object oriented. 
 however, it's not correct to say they aren't. also Perl has OOP of course and is not purely procedural.
tit - Feb. 16, 2005 8:25 am:
 Well, PHP is'nt highly object-oriented, as Java, C++ or Python, but it supports classes, interfaces,
 private/public/protected definitions, static methods, abstract classes, etc. since PHP 5.0.0
Anonymous User - Feb. 23, 2005 12:18 pm:
 I think its extremely confusing to have the user comments in the middle of the page.
Anonymous User - Mar. 8, 2005 2:30 pm:
I think it's confusing too. Why do we need user to comment in the middle, mess up my flow of reading.
Comments
 has no place in a manual, except when it's requires further explanation.
Anonymous User - Mar. 24, 2005 4:25 pm:
Definitely agreed, there should perhaps be footnotes instead that reference different comment sections at the
 bottom of the page. I don't want to read an argument about whether or not PHP and ASP are object oriented
 when I'm trying to read a manual. That said, I've just contributed to the problem...
Anonymous User - Mar. 30, 2005 3:16 am:
For people who are only interested in reading the article, comments can be turned off using "COM OFF" option
near
 the top of the page.
aquila_deus - Apr. 12, 2005 8:02 am:
 PHP and ASP support OO, but most people who use them don't use OO, and a large part of their frameworks are
 also non-OO (PHP uses procedures almost everywhere!). The same situation applies to Perl as well. Thus it's
 correct to call them "Non-OO".
Anonymous User - June 20, 2005 9:51 am:
 I think this comments are very annoying. They have no place in the middle the text. Please somebody let's do
 something about this
gdeckler - July 28, 2005 1:26 pm:
 Hmm, perhaps PHP doesn't suck so bad after all considering their website seems to have a much better handle
 on this whole commenting-in-the-manual business. BTW it is patently ridiculous to say that the primary
 advantage of your system over others is the "object-orientation" when the other systems you are comparing
 yourself have that as well. Perhaps you meant to say that the primary advantage of your system is that you
 lock people into a single way of doing things versus giving them flexibility?
Anonymous User - Oct. 11, 2005 7:02 pm:
 People, before talking about something you (seemingly) don't know, please read
 http://msdn.microsoft.com/netframework/.
Anonymous User - Oct. 27, 2005 10:34 pm:
 WARNING: The above link goes to microsoft.com. You should probably not click it

Object Publishing

The technology that would become Zope was founded on the realization that the Web is fundamentally object-oriented. A URL to a Web resource is really just a path to an object in a set of containers, and the HTTP protocol provides a way to send messages to that object and receive its response.

Zope's object structure is hierarchical, which means that a typical Zope site is composed of objects which contain other objects (which may contain other objects, ad infinitum). URLs map naturally to objects in the hierarchical Zope environment based on their names. For example, the URL "/Marketing/index.html" could be used to access the Document object named "index.html" located in the Folder object named "Marketing".

Anonymous User - June 2, 2005 11:58 am:
 gheez, its pretty fun to add comments ourselves anywhere we want it too... but it could be great that it
 could be hidden and then activated if we want to read those comments. Because now, it craps the reading
 flow...
Anonymous User - June 2, 2005 11:58 am:
 gheez, its pretty fun to add comments ourselves anywhere we want it too... but it could be great that it
 could be hidden and then activated if we want to read those comments. Because now, it craps the reading
 flow...
Anonymous User - Aug. 26, 2005 9:05 am:
 Hi, les ricains, 
 Première ligne, deuxième phrase :
 Dites voir on écrit "An URL" non ?
Anonymous User - Sep. 29, 2005 7:37 am:
 No, the letter 'U' is pronounced with a 'y' sound.

Zope's seminal duty is to "publish" the objects you create. The way it does this is conceptually straightforward.

Anonymous User - Oct. 27, 2005 10:24 pm:
 Yeah, my ass.

  1. Your web browser sends a request to the Zope server. The request specifies a URL in the form protocol://host:port/path?querystring", e.g. http://www.zope.org:8080/Resources?batch_start=100.
  2. Zope separates the URL into its component "host", "port" "path" and "query string" portions (http://www.zope.org, 8080, /Resources and ?batch_start=100, respectively).
  3. Zope locates the object in its object database corresponding to the "path" (/Resources).
  4. Zope "executes" the object using the "query string" as a source of parameters that can modify the behavior of the object. This means that the object may behave differently depending on the values passed in the query string.
  5. If the act of executing the object returns a value, the value is sent back to your browser. Typically a given Zope object returns HTML, file data, or image data.
  6. The data is interpreted by the browser and shown to you.

Mapping URLs to objects isn't a new idea. Web servers like Apache and Microsoft's IIS do the same thing. They translate URLs to files and directories on a filesystem. Zope similarly maps URLs on to objects in its object database.

A Zope object's URL is based on its "path". It is composed of the ids of its containing Folders and the object's id, separated by slash characters. For example, if you have a Zope "Folder" object in the root folder called Bob, then its path would be /Bob. If Bob is in a sub-folder called Uncles then its URL would be /Uncles/Bob.

Anonymous User - Aug. 10, 2004 12:34 am:
 Can you make URLs like: /folder/object/action-on-object/parameter-to-action-on-object/ ..?

There could also be other Folders in the Uncles folder called Rick, Danny and Louis. You access them through the web similarly:


/Uncles/Rick
/Uncles/Danny 
/Uncles/Louis

The URL of an object is most simply composed of its host, port, and path. So for the Zope object with the path /Bob on the Zope server at http://localhost:8080, the URL would be http://localhost:8080/Bob. Visting a URL of a Zope object directly is termed calling the object through the web. This causes the object to be evaluated and the result of the evaluation is returned to your web browser.

Anonymous User - Apr. 14, 2004 2:45 pm:
 why the url contains port...is there anyway can remove it?
Anonymous User - Apr. 22, 2004 4:55 pm:
 Yes, just run on the browser default port (80) instead of the Zope (also Tomcat) default (8080). How to
 change this in the configuration is left as an excercise for the reader. :)

For a more detailed explanation of how Zope performs object publishing, see the Object Publishing chapter of the Zope Developer's Guide.

Anonymous User - Apr. 30, 2005 6:37 pm:
 My Test comment
Anonymous User - Sep. 29, 2005 7:40 am:
 My test comment - is better than yours
Anonymous User - Oct. 11, 2005 3:14 pm:
 This is really stupid...
 So, I join you :)
Anonymous User - Oct. 19, 2005 8:18 am:
 Great idea !

Through-The-Web Management

To create and work with Zope objects, you use your Web browser to access the Zope management interface. All management and application development can be done completely through the Web using only a browser. The Zope management interface provides a familiar Windows Explorer-like view of the Zope object system. Through the management interface a developer can create and script Zope objects or even define new kinds of objects, without requiring access to the file system of the web server.

Anonymous User - June 24, 2004 4:22 pm:
 Should be: Windows-Explorer-like
Anonymous User - Aug. 8, 2004 9:30 pm:
 Actually it shouldn't be. Windows Explorer is the name of a program, and you don't change the name in any
 condition.
Anonymous User - Oct. 4, 2004 8:36 am:
 Windows Explorer is not neccesarily familiar
Anonymous User - Oct. 16, 2004 8:38 pm:
 Should be hierarchical, not Windows Explorer-like
Anonymous User - Nov. 27, 2004 5:06 am:
 What about Windows-Exploder-like? seems to be more appropriate
Anonymous User - Jan. 24, 2005 4:25 pm:
 What is Windows?
Anonymous User - Jan. 25, 2005 6:00 pm:
 The way it is currently implemented is correct. Take a 5th greade English class, please.
Anonymous User - Feb. 14, 2005 10:47 pm:
 Current implementation is correct, as above user stated. However, above user misspelled "grade" when
 suggesting others to take a basic English course, which should be classified as funny.
Anonymous User - Mar. 10, 2005 6:52 pm:
 I would like to answer the question, "What is Windows?"

 The expression "window" refers to a region on a graphical user interface into which a user enters his input
and the application displays its output. This typically would be a portion of the display screen on the users
 terminal. A number of operating systems have adopted "windows-style" interfaces, including X-windows, which
comes with most Unix and Unix-like systems, the original and new MacIntosh operating systems, BeOS, OS/2 just
 to name a few.
Anonymous User - Mar. 14, 2005 10:36 pm:
 "Windows Explorer" is a proper noun. You don't f***ing hyphenate it. While I'm at it, grow up you immature
 imbecile and stop cluttering the documentation!
Anonymous User - Mar. 22, 2005 9:55 pm:
 ^^^^ Thank you for spoiling the fun I had reading the documentation and comments. Why does there HAVE to be
 an irrespectful person like you anywhere? Off I go to the alternative : 'uncluttered' PDF
Anonymous User - Apr. 13, 2005 6:55 am:
 Make it 'Windows Explorer'-like or ((Windows Explorer)-like) or whatever, but please don't spoil the fun.
Anonymous User - June 12, 2005 1:22 pm:
 swearing is f***ing fun ;)
Anonymous User - Sep. 29, 2005 7:41 am:
 heheheh
Anonymous User - Oct. 11, 2005 3:18 pm:
 I must give up...
 I think the zope guys did it on purpose ...

 Are you having fun...?

Objects can be dropped in anywhere in the object hierarchy. Site managers can work with their objects by clicking on tabs that represent different "views" of an object. These views vary depending on the type of object. A "DTML Method" Zope object, for example, has an "Edit" tab which allows you to edit the document's source, while a "Database Connection" Zope object provides views that let you modify the connection string or caching parameters for the object. All objects also have a "Security" view that allows you to manage access control settings for that object.

Security and Safe Delegation

One of the things that sets Zope apart from other application servers is that it was designed from the start to be tightly coupled not only with the Web object model, but also the Web development model. Today's successful Web applications require the participation of many people across an organization who have different areas of expertise. Zope is specifically designed to accommodate this model, allowing site managers to safely delegate control to design experts, database experts and content managers.

Anonymous User - May 11, 2005 7:34 am:
 krikri

A successful Web site requires the collaboration of many people in an organization: application developers, SQL experts, content managers and often even the end users of the application. On a conventional Web site, maintenance and security can quickly become problematic. How much control do you give to the content manager? How does giving the content manager a login affect your security? What about that SQL code embedded in the ASP files he'll be working on - code that probably exposes your database login?

Objects in Zope provide a much richer set of possible permissions than a conventional file-based system. Permissions vary by object type based on the capabilities of that object. This makes it possible to implement fine-grained access control. For example, you can set access control so that content managers can use "SQL Method" objects, but not change them or even view their source. You can also set restrictions so that a user can only create certain kinds of objects, for instance "Folders" and "DTML Documents" but not "SQL Methods" or other objects.

Zope provides the capability to manage users through the web via "User Folders", which are special folders that contain user information. Several Zope add-ons are available that provide extended types of User Folders that get their user data from external sources such as relational databases or LDAP directories. The ability to add new User Folders can be delegated to users within a subfolder, essentially allowing you to delegate the creation and user management of subsections of your website to semi-trusted users without worrying about those users changing the objects "above" their folder.

Native Object Persistence and Transactions

Zope objects are stored in a high-performance transactional object database known as the Zope Object Database (ZODB). Each Web request is treated as a separate transaction by the object database. If an error occurs in your application during a request, any changes made during the request will be automatically rolled back. The object database also provides multi-level undo, allowing a site manager to "undo" changes to the site with the click of a button. The Zope framework makes all of the details of persistence and transactions totally transparent to the application developer. Relational databases which are used with Zope can also play in Zope's transaction framework.

Acquisition

One of the most powerful aspects of Zope is "Acquisition", and the core concept is simply that:

Anonymous User - July 14, 2005 4:12 pm:
 Moichandizing!  Moichandizing!  Zope calls Inheritance Acquisition.  Woop Dee Do!
Anonymous User - Oct. 5, 2005 8:57 am:
 It's not just inheritance; it's a combination of inheritance and composition. As for merchandizing ... well,
 it still may well be that.

  • Zope objects are contained inside other objects (such as Folders).
  • Objects can "acquire" attributes and behavior from their containers.

The concept of acquisition works with all Zope objects, and provides an extremely powerful way to centralize common resources. A commonly used SQL query or snippet of HTML, for example, can be defined in one Folder and objects in subfolders can use it automatically through acquisition. If the query needs to be changed, you can change it in one place without worrying about all of the subobjects that use the query.

Anonymous User - May 16, 2005 12:57 pm:
 inheritance
Anonymous User - June 22, 2005 6:25 am:
 ya!!! simple inheritance
Anonymous User - Sep. 6, 2005 7:04 am:
 A base class is not a container for a derived class, and neither are objects of those classes. No,
 acquisition is not simple inheritance, although they share some aspects.

Because objects are acquired by starting at the current level in the containment hierarchy and searching upward, it is easy to specialize areas of your site with a minimum of work. If, for example, you had a Folder named "Sports" on your site containing sports-related content, you could create a new header and footer document in the Sports Folder that use a sports-related theme. Content in the Sports folder and its subfolders will then use the specialized sports header and footer found in the "Sports" folder rather than the header and footer from the top-level folder on the site.

Acquisition is explained further in the chapter entitled Acquisition.

Zope Is Extensible

Zope is highly extensible, and advanced users can create new kinds of Zope objects, either by writing new Zope add-ons in Python or by building them completely through the Web. The Zope software provides a number of useful built-in components to help extension authors, including a robust set of framework classes that take care of most of the details of implementing new Zope objects.

Anonymous User - Mar. 11, 2005 8:21 pm:
 Ceci est un commentaire ...
 En voici un autre ...
90% des commentaires que je lis d'autre personnes sont aussi utiles pour moi que celui-ci l'est pour 100% des
 lecteurs.
Anonymous User - Oct. 11, 2005 3:21 pm:
 Notre pulle dans votre cour!
 marfa...
Anonymous User - Oct. 21, 2005 4:20 pm:
Hey, keep your damn frog language off this God-fearing, red-white-and-blue (and I mean stars and stripes, not
 your crappy tri-color flag) American page! >:O

A number of Zope add-on products are available that provide features like drop-in Web discussion topics, desktop data publishing, XML tools and e-commerce integration. Many of these products have been written by the highly active members of the Zope community, and most are also open source.

Anonymous User - Jan. 17, 2005 6:30 pm:
 most??

Fundamental Zope Components

Zope consists of several different components that work together to help you build web applications. Zope's fundamental components are shown in the figure below, and explained following the figure.

Anonymous User - Mar. 24, 2004 5:50 pm:
 The immediate question this portion brings to mind is: when is it necessary, from an engineering standpoint,
 to use a different web server or backend database from the Zope built-ins? I can't imagine it's purely a
 question of preference. A pointer to where this is covered elsewhere would suffice.
Anonymous User - Apr. 24, 2004 9:56 am:
Easily answered. In evaluating the desirability of Zope, the FIRST thing I checked was to ensure that systems
 outside of Zope and on remote hosts could access data shared with Zope. A MySql backend gives me some reason
 to believe this is possible. The next question is the Single-Signon agent that has an Apache plugin. That is
 also apparrently workable.
Anonymous User - Aug. 26, 2004 11:42 am:
In the comment below, "Zope comes with its own server" and then "Of course you might have your own web server
 and Zope works with that too ..." but the diagram certainly does not serve to explain just how. Furthermore
 it does not show how many daemon processes are involved. Every hosting firm in the Universe is going to have
 a web-server daemon, but if they now have to run two server daemons ... ?

Zope Architecture

Figure 2-1 Zope Architecture

Anonymous User - May 11, 2004 1:26 pm:
What do you mean exactly with Zope Core? You said that it's web ORB, but what exactly does it mean? Some more
 explanation of the architecture would be really usefull (links...).
ZServer
Zope comes with a built in web server that serves content to you and your users. This web server also serves Zope content via FTP, WebDAV, and XML-RPC (a remote procedure call facility).
Web Server
Of course, you may already have an existing web server, such as Apache or Microsoft IIS and you may not want to use Zope's. Zope works with these web servers also, and any other web server that supports the Common Gateway Interface (CGI).
Zope Core
This is the engine which coordinates the show, driving the management interface and object database.
Object Database
When you work with Zope, you are usually working with objects that are stored in Zope's object database.
Relational database
You don't have to store your information in Zope's object database if you don't want to. Zope works with other relational databases such as Oracle, PostgreSQL, Sybase, MySQL and others.
File System
Zope can of course work with documents and other files stored on your server's file system.
ZClasses
Zope allows site managers to add new object types to Zope using the Zope Management Interface. ZClasses are these kinds of objects.
Products
Zope also allows site managers to add new object types to Zope by installing "Product" files on their Zope server's filesystem.
Previous Page Up one Level Next Page Zope Concepts and Architecture Comments On/Off Table of Contents