On Fri, 2002-09-27 at 07:11, Ben Logan wrote:
> On Thu, Sep 26, 2002 at 02:42:11PM -0500, Ian Bicking wrote:
> [...]
> > Yes, Webware would be appropriate for this sort of application.  It's
> > still similar to PHP in terms of session data, but hopefully it would
> > still be simpler.  I'd recommend you spend time putting all the hard
> > work (with the databases and statistics generation) into a plain Python
> > module (i.e., one that doesn't use Webware in any way).  Then you can
> > use Webware servlets to provide an interface to this module.  This will
> > help keep your code cleaner, and probably make the programming more
> > pleasant.  
> 
> I would really like to design the program that way, because I would
> also like to have a compatible, non-web version (perhaps with wxPython
> or even ncurses as an interface).  Ideally, there would be a module
> that could be hooked with any UI desired.
> 
> One question I have is regarding how to store my data in the database.
> The records I'm dealing with could be nicely represented by a set of
> interrelated Python objects.  Is it better to simply pickle these
> objects and store the results in the SQL database, or better to
> rebuild the objects from the database rows each time the data is
> retrieved?

If you want something to help you rebuild your objects, you are looking
for an Object Relational Mapper -- there are several out there. 
MiddleKit, included with Webware, is one of them (it doesn't actually
have any Webware dependencies, though, so you can use it without
Webware).  There's lots of others, as well.

ZODB will take care of the pickling if you like, but you can also do it
yourself if you don't have much data that needs to be persistent like
this.  I often use pickle for small parts of the data that don't
translate well to SQL (often runtime extensible objects).

BTW -- you should also consider using XMLRPC for alternate interfaces. 
Then you are still location-independent, but don't have to put
everything through a browser.  It's very easy to work with, both client
and server (see XMLRPCServlet in Webware for the server side).

  Ian




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to