[Zope] Q: How are interactive web apps done?

Robb Shecter shecter@darmstadt.gmd.de
Mon, 24 Jan 2000 13:02:12 +0100


Hi,

Thanks for the reply.  Over the weekend I read the Zope Content Manager's
Guide, the Developer's Guide and the DTML reference.  I'm still trying to
get a handle on everything, though.

Michel Pelletier wrote:

> > A typical servlet-based web app uses the servlet API to automatically
> > generate a session object for each user.  (The API maintains the
> > session by either a cookie or url rewriting.)
>
> Similar mechanisms are employed by current Zope Session Products.
>

Do you mean the FSSession and SQLSession products?  I found them by
searching at zope.org.  They seem to be similar except where they store the
session info.  Is this right?

> ...Acquisition...

Yes, acquisition seems like a very nice mechanism that may be more
appropriate than inheritance for lots of cases.

> ...I suspect Zope provides a much higher level framework than you're used
>
> to.

Yes, absolutely.  If possible, I'd like to use the high level features.
It's still not so clear to me, though, how the parts fit together.

In servlets, you've got your server (app-logic) objects that are long
lived, and can be accessed by servlets.  The servlet framework uses a
Template Method pattern:  A servlet has an init() methods that's called
once, and then a get() or post() method that's called per invocation.  This
is nice for setting up db and server connections, etc.

In Zope is this accomplished by Python classes that get used as external
methods?


> ...You can get down and dirty, in Python.  You can completely discard
> Zope's authentication and acquisition mechanisms and just use it's
> object publishing ORB and some database modules to simulate what Java
> Servlets give you.

But I'd like to use the high-level features if I can.  I'm wondering, for
example, what the architecture would be for a site like "my.yahoo.com", or
"zope.org", where a user can create an account through the web, and have it
verified by email.  Then, when "logged in", the site can react in a
stateful way to the user's actions.

> A relational database could be a good place if you used UserDB, which is
> a Zope authenticator which works against RDBMs.  I'm assuming this would
> be the method you are acustomed to with Servlets.
>

I actually just defined my own User classes, and persist them in XML or
serialized files.  I was about to look for a real rdbms, and decided to
check out moving to Zope, since it has one combined with it.

- Robb