[Zope] Product Creation Comments
Martijn Faassen
M.Faassen@vet.uu.nl
Thu, 11 Feb 1999 18:36:40 +0100
Hi there,
For a while now I've been wrestling with product creation. I have as yet
have to finish a product. I've read the 'Approaching the Zope Product
API' tutorial, and while I understand it fine (I think), and it explains
things just fine, I still find the product creation process too
cumbersome for my tastes. This may be me, but perhaps it may help the
Zope community if I utter my frustration; at a minimum it'll help me.
Also note that as a whole I think Zope is just brilliant.
Here are my comments:
In Python, testing new code is easy; this is one of the advantages of
interpreted languages. It also helps that Python is elegant and gives
good error messages. The Emacs python-mode is also very useful.
Zope for the most part also displays some of this elegance. Making new
web pages is easy; you see results directly. Acquisition combined with
DTML is a very powerful system. It's also trivial to add external
methods in Python.
Zope may however be too big, have too many interesting parts, for a
single human to grok it quickly; this may be why we speak of 'Zope Zen'.
I think this inevitable as Zope also does a lot. And better
documentation may always help.
The Product API is an exception; I keep stumbling. It's *not* easy to
test new products, or if it is nobody has told me how. I want to know if
I'm doing it right while I'm developing a product, and at a certain
point there seems to be a looong gap in development where you simply
can't test (or I don't know how to). I'll attempt to describe the
biggest gap for me; the gap I haven't crossed yet.
You can write a Python class that is to be the product. We'll take the
poll as an example. First we test it in Python with a test() function.
So far so good. That's just regular Python.
Then we add the user interface with DTML. After some initial learning
with DTML, this step is easy too. It's just a question of importing
DocumentTemplate and adding a single attribute to the class
(index_html). Minor stumbling block is that the non Zope python doesn't
have the Zope modules on its module search path. Adding them resolves
this; I'm not sure however if I fixed it completely (insert completely
vague failures and complaints here :).
You can test the generated HTML easily in a python test function, then.
Minor step.
Then we have a publishable object. We can test it with a test_poll.py
file that creates the object to be published. We can call the Zope
debugger to see if it all comes out okay. No problem.
Now we try to make the leap from publishable object to Zope product. The
tutorial says there is a long way between these two; and there is!
The big gap trouble starts here. Suddenly, we don't import
DocumentTemplate anymore, instead we do a 'from globals import HTMLFile'
for general DTML support. We also import a number of other things.
Suddenly I can't test anything anymore - not with a python test function
or with the zope debugger, it seems. I get an error message that
complains about the variable 'trueself' that was omitted from the
request.
So after this I can't test things anymore. I still need to make a
creation form and a product installation method. In the tutorial it
mentions the process of turning publishable product into product is a
bit tedious and that in the future there will perhaps be a more
streamlined process. I hope this future arrives soon, as after this,
still without apparant ability to test, I need to add a producting
editing form, a product editing method, define Zope permissions,
management tabs, a meta type, and a product icon. The system gives no
feedback on any of these. Then finally, I can install the poll and test
it.
This is too big a bound for me, somehow. I am able to do all the steps,
but I keep getting bogged down, starting over, knowing I can't test
anything yet. It breaks the quick Python development cycle; it's even
slower than my C++ development cycle. There are too many steps that
don't seem to fit into my short term memory. Part of the program design
I do during prototyping. I can't seem to do this with products.
A way to resolve this would be:
* A lot more practice by me. I'm doing this. :)
* A way to test each step somewhat better. Feedback from Zope telling
you if you're still on the right course.
* A more automated process of poll creation. I'm starting to think about
what this should look like. I can probably eventually help with
design/implementation, if I keep butting my head at product creation
enough.
* I'm missing something. "Martijn, when I create a product I do so and
then so and it's really easy and quick."
* products are beyond Martijn's feeble mind and he just should give up.
:)
I want to see more products for Zope. I want to *make* products for
Zope. If it were easier somehow, there would be more products for Zope,
which would be good for everybody.
Enough of my lament. I hope it helps somebody else; otherwise ignore all
as frustration relief. And again, I do like Zope.
Regards,
Martijn