On Tuesday 03 February 2004 01:19 pm, patrick sullivan wrote:
i was trying to think of a way to make my scripts more OO in design, taking advantage of python. i was thinking of the short term by making a script(python) object, and having a class definition for some object, such as
IMHO, if you are sharp enough to write OO code, you'll probably be happier writing a Zope Product instead of a script. That way you create an object (or objects) that are specialized for the job you want to do. Look at the Zope Developer's Guide on the zope.org website for guidance on how to start that (there are books and other resources available, too). Trying to create objects and manipulate them *within* Python scripts is kind of obtuse -- the objects have to get created each time the script runs, and it's typically going to be very convoluted and inefficient as a result. You should think of scripts as "methods" of the folder object they are contained in (as well as of any object which can *acquire* them, of course). Inside Zope Products, though, OO is the way to go, definitely (in fact, you can hardly avoid it). Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com