[Zope] Comments? To create products with Python or with ZClasses

Jason Spisak 444@hiretechs.com
Fri, 05 May 2000 19:34:56 GMT


Kevin:

<snip wonderful contribution to start a discussion>

> Development Tools
> 
>   PyProds are clearly at an advantage in terms of development
>   tools. Creating ZClasses and propertysheets, and adding views
>   and methods to a ZClass are certainly very user friendly
>   processes. However, editing code in a textarea has some definite
>   drawbacks.

Agreed.

>   Since PyProds reside in the filesystem, it is very
>   easy to use your favorite editor, CVS, grep and other tools when
>   working with your code.
> 
>   ZClasses will be getting help down the line in the form of
>   the ZopeStudio Mozilla app. Currently, you can edit your code
>   using your favorite editor if it supports FTP.

I was under the impression that FTP'ing into the a ZClass isn't supported
at the moment (I've tried it and it doesn't work still).  I would gladly be
corrected.

>   It also seems
>   possible to create some simple tools that allow you to edit your
>   ZClass code locally, store it in CVS, and send the changes through
>   via XML-RPC or ZClient.
> 
> Flexibility
> 
>   PyProds win in the flexibility department as well. In order to keep
>   evil people from gaining access to your box through your website,
>   through the web components can only do a subset of what Python can
>   do. For example, you can't open files in DTML or a PythonMethod.
>   PyProds live in the file system, and therefore have access to
>   all Python and Zope services. It is also likely to be a lot faster
>   to create a relatively complex object hierarchy in Python than
>   it would be to build it up through the web.
> 
>   A very important flexibility issue with ZClasses is that once you've
>   created the ZClass, there is no guaranteed way to change the base
>   classes. 

Ugh.  I've been bitten by this too many times to count.  *.-| So I am
building my Base classes in Python too.

>   There are apparently some really deep issues behind this.
>   To give yourself the ability to change base classes later on, it is
>   probably wise to create a Python base class for your ZClass and have
>   that class inherit from the appropriate other classes. Then, you can
>   just change that little bit of Python in order to add or remove a base
>   class. This has the added benefit that you can easily make minor
>   additions to your ZClass that would not be possible through the web
>   (such as writing a custom object traversal handler).
> 
> Ease of Programming
> 
>   Once you get into the swing of it, ZClasses are quite easy. Writing
>   complicated DTML Methods is not necessarily a fun thing, but
>   PythonMethods give you a way to avoid complicated DTML and still
>   develop through the web.
> 
>   The single biggest reason that I don't develop my products in
>   Python is the fact that you need to restart Zope to test your
>   changes. 

I there any other was besides the pdb to test you products without
restarting zope?  I really think that'd be worth me trying.  I wouldn't
know where to start though.  From what I know, Python modules can just use
the "reload" command.  Why doesn't Zope have that?

>   For that reason, it is probably best to test your classes
>   directly from the Python interpreter rather than through Zope.
>   This allows you to see the changes much more quickly. Once you think
>   your classes are basically working, you can fire up Zope and try
>   it from the web.
> 
>   While that method certainly will get the job done, I find
>   programming with ZClasses to be a nice fast process. You can
>   have two browser windows going, one with the code and one
>   where you're testing the code. The process of making a change
>   and trying it out is very fast.

That's my experience as well.  No substitute for this in Production where a
restart makes Zope look unstable.

> 
>   I also find that Versions are very nice for minor bug repair
>   on a production system.

MTC,



Jason Spisak
CIO
HireTechs.com
6151 West Century Boulevard
Suite 900
Los Angeles, CA 90045
P. 310.665.3444
F. 310.665.3544

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.