[Zope-dev] a simple example of the ZPatterns frame work

Phillip J. Eby pje@telecommunity.com
Wed, 17 May 2000 16:49:02 -0500


At 08:39 PM 5/17/00 +0400, Jepthte CLAIN wrote:
>
>I wonder if someone can send me a simple example using the ZPatterns
>framework. I read all the source, and I still can't figure out what is
>the relationship between the objects instantiated by the Racks and the
>Rackmountable objects. Also, why do the rack try to instantiate a
>ZClass???

When created, Racks create some default Attribute and Sheet providers.
These objects are used by Rackmountables to access data which is not stored
directly in the rackmountable.

When used, Racks create instances of the ZClass you've specified.  If you
call newItem(key), you will receive a new instance of that ZClass, which
will be stored in the rack under the specified key.  Whenever you call
getItem(key), the instance will be retrieved.  Some Racks, like
GenericUserSource, do not store items in themselves, but in external
databases.  When you call getItem(key) on a GUS, it calls methods to access
the external database, then creates an instance of the appropriate
LoginUser subclass and returns that.

Hope that helps; I'm not 100% clear on your question.