[Zope] What is the zope way to do this ?

Johan Carlsson johanc@torped.se
Fri, 31 Dec 1999 10:17:29 +0100


As I understand your question you want to store 
your objects in ZODB, not in a RBMS? 
In that case all you got to do is inherit the 
Globals.Persistent to make your objects persistent
inside the ZODB.

Off course you need to add some other stuff as well.
Basically your have to chooses: ZClasses or Zope Products.
Personally I prefer Zope products mostly because I 
have some problems getting along with DTML.
There should exist one or more Zope Product HOWTO's 
on the Zope.org (or the www.zope.org:8080 [old site]) 
that you might want to read.

Products are kept in the lib/python/Products directory.
But your supporting class files can be kept in the 
lib/python/Shared/Your_org_name/ directory.

Placing your application classes in Shared/Your_org_name 
might help you separate your application from Zope.
Another approach would be to make your application 
talk to Zope via XML-RPC, turning it in to a client-
server solution?

The GUI is easy implemented with DTML both from ZClasses 
and from Zope products.


Best Regards,
Johan Carlsson



> KeyWords : Business Objects, Persistency, ZODB.
> 
> Hello all,
> 
> I've been playing with Zope for a few weeks now...I really
> like it ! The problem I have is that, given a problem, I don't
> know what Zope technology I should use...
> Here is my problem :
> 
> I have designed a small object application with UML.
> I then have implemented it in python. Only the business rules
> of my application are written yet (no UI nor GUI).
> The whole application source is made of 3 python files (.py).
> Python objects are persistent and stored into a file using the
> shelves mechanism (that I found to be very simple and handy).
> I test the core of my application in the console, invoking methods
> of my objects. Storage is correct, etc...
> 
> Now that I know that my application "could" work (=all the business rules
> and methods have the correct behaviour), I want to access it through
> the web (=make a web application). I would like to use Zope to do so.
> 
> First, I can modify my existing python code (to make it compliant with
> any Zope mandatory things - that I don't know yet !).
> 
> [1 - Dealing with the Storage of my Objects]
> I don't want to deal with any Relational storage directly. I would like to
> go on using a full object approach : to have persistent python objects.
> Use of OQL would be nice, but not mandatory for my first needs.
> At last, I don't want to have to store/retrieve my objects from a SQL
> database by hand...The persistent mechanism should be as easy to use
> and handle as the shelves one(I don't need to use shelves in 
> particular - I
> just want an object-storage mechanism). There is no need for me to have
> access  to the today-existing datas (that were store in files from the
> shelves mechanism).
> 
> [ 2 - Dealing with the visual HTML representation of my objects ]
> I would like to have a strong frontier between the rendering of data
> (=production of HTML code) and the logic of my application (=python 
> code that handles the life of my objects).
> 
> [ 3 - Reusability - Luxe ]
> I would also like to be able to use the same python code in both
> the console and web version (not mandatory).
> 
> Given this, I don't know what Zope mechanism is best for me : ZClasses ?,
> ZCatalog ? External method ? Other ? Should I make a product ? Where 
> can I put my existing python code ? How will I deploy it to 
> several sites ?
> How do I store my business objects into ZODB ?
> 
> If I am not clear enough : you can flame me ! I will explain it again :-)
> 
> Please help !
> Thanx for your support.
> 
> Olivier Deckmyn,
> Paris - France.
> 
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>