[Zope] Zope Zen needed

Jody Winston jody@sccsi.com
Wed, 25 Aug 1999 21:56:46 -0500 (Central Daylight Time)


I need some help with the Zen of Zope and SQL.  I've tried several
different approaches and I have not been happy with either result.

The goal of this Zope project is to allow individuals with different
roles (e.g. views) to perform queries of objects in a database.  These
queries will run from simple queries, such as how many times a company
has used a service, to complex queries to build final reports.

Zope was selected over a report generating product since Zope provides
security, a web based management system, different ways to submit and
to retrieve data, and Zope didn't tie us to a single, closed, data
source.

The first approach was to have the most frequently used queries for
each role stored along with some code to render them.  This was too
static and inflexible for the "power" users.  The advantages were that
the data was always insync with the SQL database since it was always
generate from the database and that we knew how long the queries would
take.

The next approach was to used the primary keys in the table to
generate trees of the data.  This approach allowed quick navigation
and retrieval of the data.  The disadvantage was that selecting the
data by it's primary key does not allow us to select data that the
role was interested in.

The third approach was to build ZClasses that had the same attributes
as a row of the data in a given table.  The attributes of a given
instance were then populated from the results of an ad-hoc query.  The
GUI for querying the data was changed to be a form with multiple
selection fields for every attribute in the class.  ZClasses allowed
the results of the queries to be stored in ZODB.  The traversal of the
results, a tree, can then be traversed and examined with the normal
Zope mechanisms.  This feature comes at the cost that the results of
the queries will become out of sync with the database.  The ad-hoc
queries from this approach will not be as fast as optimized queries.

I'm starting to lean towards a hybrid approach of canned queries for
the 80% solution with forms for the other 20%.  What's the general
thoughts on this approach?  Will the use of the ZClasses help when the
underlying data is in a SQL database?

Another issue is disconnected access from the main database/Zope
server.  A portion of the data from the database, either from ZODB or
the SQL database, needs to be replicated from the server to the client
at the client's request.  The client then will become a its own server
until the client reconnects with the main database/Zope server.
Currently, we do not need to rectify the differences between the two
Zope instances, but I can see that day coming.  Any ideas on how to
support this need with Zope?

Jody Winston