hello all: 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 class Generic_Table: or somesuch. then i was going to instaniate that object in another script(python) object. is this counter to the "way of zope" or is an acceptable path? all i am really trying to accomplish is more objects less one script to do one thing. if this is way off base, feel-free-to-flame thanks, patrick __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - Let the expert host your site http://webhosting.yahoo.com
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
participants (2)
-
patrick sullivan -
Terry Hancock