[Zope3-dev] Zope3 comments and questions.

Lennart Regebro lennart@regebro.nu
Mon, 10 Dec 2001 15:15:49 +0100


This is the comments and questions I have after going through the
PythonProgrammerTutorial/Chapter1. Excellent tutorial by the way, and Zope3
looks and feels mostly excellent too!

1. Zope.Products.foo.foo.foo = .foo
Having "smarts" that remove an amount of typing can make things more
confusing. Saying not having to specify Zope.Products is good, but not
specifying repeating elements is a bit too much magic. A new user will have
trouble understanding why ".Contact" works but ".People" doesn't, when they
are both specified in the same module, or both modules in the same
directory, since you mostly learn what to do and how to write things by
mimicking others, instead of RTFT as you should.

"Smarts" should be rather obvious. Like that you don't have to care if a
form used POST or GET. That a dot in the beginning may expand to three
repeats is not that obvious.

2. Clearer structure
lib/python/Zope/Products is not the most place to put a product for
newbies. It's no problem having products that are a part of the Zope
distribution there, but new additional products, both downloaded and
self-developed, should probably go into a Products folder in the root
installation. That will make it MUCH easier for Zope newbies to
understand whats going on.

3. Protection of interfaces.
I dont understand why extended interfaces can't be protected (step 4):
  "Note that we protect the 'update' method by name, rather than by
  interface. We can't protect the 'IContactEdit' interface because
  'IContactEdit' extends 'IContactInfo', which is protected by a
  different permission."

4. Assertions in the interface definitions
Why assert in the interface definition in the Tutorial? It's not intuitive
to me. Shouldn't the class specify the interface it implements with
__implements__ ?

5. container vs here
How come the edit presentation uses "container" where the view
presentation uses "here"?

6. Marker interfaces
Why create "marker interfaces? Couldn't you just specify the class directly
instead of creating and essentially empty and rather useless interface?
  "The tabs are defined using a new 'IContact' interface, defined in
  the 'IContact' module. This is a "marker" interface. It doesn't
  actually specify any contacts but provides a way of very
  specifically tagging certain classes (usually one).  We do this for
  tabs because we usually want very specific control over the tabs
  that a content object displays."


So, now I'm ready to start trying to make my first Zope3 product I guess.
Any suggestions?
I was thinking about redoing my EasyImage object, since I'm familiar with
that code...