[ZDP] BackTalk to Document Zope Developer's Guide (2.4 edition)/Object Publishing
Wed, 25 Sep 2002 17:21:34 -0400
A comment to the paragraph below was recently added via http://www.zope.org/Documentation/Books/ZDG/current/ObjectPublishing.stx#2-4
% limaye - Sep. 25, 2002 5:21 pm:
The Zope side [the server side of the above figure] can be thought of as a collection of containers [zope
server container, zope publisher container, etc.] - each responsible for managing a set of issues [e.g., the
zope server container manages "sessions" with its clients (http, ftp, webdav, xml-rpc) and could also decide
on the issues like load balancing, security etc.] The zope publisher container can provide services of
mapping the URL path to the zope object and of dispatching the request; prior to dispatching the request the
publisher would also validate the access control constraints; help provide transaction control; load the
object in memory; provide life cycle support to these zope objects; provide the object[method invocation]
with a "context" so on and so forth. As it may be obvious there is an entity relationship between each of
these containers and their childern - whose focus is on managing the call control issues - this hierarchy of
containers is used to provide a framework in which the zope objects can do the job on hand without worrying
too much about the middleware issues.
With the above paragraph setting the technical framework now [hopefully] you can see the value of interfaces.
They help publish a contract [e.g. a "set" of interfaces need to be implemented by any zope object (or by the
zope framework components themselves) so as to be integrated within the zope framework] which is implemented
by the "publishers" (don't confuse this with Zope Publisher) and consumed by the consumers. The other good
feature about the interfaces is that the consumer (which can be more than 1) need not worry about who
implements the interface and can safely assume that the invocations will be properly processed - in case of
an error the publisher of the interface will throw the appropriate exception to report it.