[Zope] Question about application design

Finlay Cannon fin at valentsolutions.com
Tue Apr 20 17:14:33 EDT 2004


Hi Robb,

Perhaps I can paraphrase Alec Mitchell's advice, if it will help to 
hear it in a slightly different way:

What it sounds like you want to do is quite simple in Zope.

Create a new Product, subclassed from a persistent class (such as 
SimpleItem), which will contain all of the code and data for your 
application. In this Product's constructor, create and initialize an 
instance of your "sparse matrix" data. Because your product is 
persistent, this data will be stored in the Zope database, and 
available to you as a regular instance variable when your other methods 
are called, just the same as if it had always been in RAM.

If your sparse matrix is a custom class (i.e., it's not just a basic 
Python list or dictionary), it may also need to inherit from a 
persistent class (such as Persistent), to make sure that it's stored in 
the database when the rest of your product data is stored.

Cheers,
Finlay Cannon



On 20 Apr 2004, at 11:36 AM, Alec Mitchell wrote:

> On Tuesday 20 April 2004 11:20 am, Robb Shecter wrote:
>> Yes, from my diving into the docs, it looks like that's the route I 
>> might
>> have to go:
>>
>> I'll have about 150,000 objects - all in one or two "Sparse Matrix"
>> containers I use.  And then I do a Dijkstra-like shortest path finding
>> algorithm over the data.
>>
>> So apparently, I can't just take this data structure and stick it in a
>> temp_folder.
>>
>> It sounds to me like Zope isn't so much an application server as a CMS
>> server.  Too bad!  For example, with Tomcat, a Java servlet engine, my
>> scenario would be pretty easy to implement.
>
> I think you'll be surprised how easy it is to create a persistent 
> container
> for that data (just inheriting Item.SimpleItem should get you most of 
> the way
> there, then you just create instances of your container data structure 
> as an
> instance variable in the constructor).  Zope is definitely more of an
> application server than a CMS (though with the right products it makes 
> a hell
> of a CMS), it is just a very different way of thinking about the 
> problem than
> a java servlet engine (or really anything else).  Though the ZMI looks 
> like a
> filesystem, it is a very powerful and general persistent object 
> storage with
> a very useful acquisition model.
>
> Good Luck,
> Alec Mitchell




More information about the Zope mailing list