[Zope] Problem Creating Instances Mysteriously Solved
Dan Shafer
pydan@danshafer.com
Sat, 20 Apr 2002 12:40:14 -0700
No, not necessarily non-Zope. I love Zope. The problem is I've spent a lot
of years developing an object mentality so I tend to design and think in
terms of objects rather than, as you say, "dumb data objects." OO is one of
the big reasons I'm drawn to Python and thence to Zope.
The application is a little hairy to describe in a short enough space to
justify taking up list bandwidth, but I'll give you a quick summary.
Obviously, any insights you have as to a solid Zope approach would be more
than welcome. I've spent a ton of time on this already and although I think
I'm getting close to understanding how to do it, I've thought that a few
times and been wrong every time!
My client's business involves a sort of therapeutic process. Clients engage
in a process called a "clearing." Each clearing has associated with it an
arbitrary number of "clearing images", a number which cannot be determined
in advance or bounded. Within each Clearing Image is, among other
properties, a collection of short text descriptions which, again, can occur
in any number from 12 to (theoretically) infinity.
So this seemed to me to cry out for objects. A Clearing Object contains one
or more Clearing Image Objects which in turn contain 12 or more Emotional
Pattern Objects. All of these objects have properties, of course.
Now, in point of fact, this is largely just data. There isn't the usual OO
notion of having methods packaged with the data that operates on the data
because the interaction with the data is largely quasi-monolithic. The user
is a professional who conducts a clearing in person or over the phone with
a client. He or she fills out HTML forms as the client describes responses
to questions and to visual images.
As I looked at using a relational DB model for this, it seemed to me that
the levels of relationalilty involved would get kind of tricky and I'm not
really a database whiz. (I'm not a Zope whiz, either, but if I'm going to
spend time mastering something, I'd sure rather have it be Zope than SQL! I
know a good bit of SQL but I hate mucking about with it.)
There is so much about Zope that I love as a Web application delivery
platform. But I need, e.g., a simplistic, non-Zope interface (i.e., a sort
of "standard" UI) for the user to start a new clearing, edit an in-process
clearing, and search for patterns among clearings. I didn't see a
straight-forward way to do this with dumb documents; creating a new
clearing, e.g., if a Clearing were a DTML document rather than a ZClass,
seemed to me to be convoluted at best.
But I'm sure open to suggestions!
At 08:15 PM 4/20/2002 +0100, Chris Withers wrote:
>Dan Shafer wrote:
> >
> > I'm going to wait a day or so and see if anyone jumps in who disagrees with
> > your assessment but if, as I suspect, you are right, then I'm going to be
> > outta here and finding a better solution to my Web application needs.
>
>Hmmm, better solution meaning non-Zope? Well, that, of course, was not my
>intention :-)
>
>My beef with ZClasses is that I just never seem to find a need for them.
>All you
>really need are very dumb data objects (I tend to use DTML Documents, although
>any PropertyManager will do...) and Python Scripts and ZPT...
>
>If you can explain a bit more about your app I'd be happy to give some
>pointers
>on how I'd tackle it. NB: This may, of course, not be the _right_ way, but...
>
>cheers,
>
>Chris