[Zope3-dev] Comments on Tutorial step1

R. David Murray bitz@bitdance.com
Mon, 11 Mar 2002 16:45:50 -0500 (EST)


In reading step 1 of the PythonProgrammersTutorial, the following
questions occured to me.  Because I haven't quite gotten a working
Z3 on FreeBSD yet, I haven't tried to actually run the step1
code yet.  Perhaps some of my questions would be answered by
experimentation, but perhaps someone will want to address the
questions in the tutorial even if that's true <grin>.


o Is INSTANCE_HOME supported?

o In the example of creating an instance of Contact, '.Contact' is
used.  Given the previous discussion I would expect this to resolve
to "Zope.Products.Contact", not "Zope.Contact.Contact".  Some
additional verbiage to explain this would probably be a good idea.

o "A different identifier could have been provided in the
zmi:provideClass' directive.  Example of doing this?  Or are the
other attributes of provideClass documented somewhere?

o What would it mean to provide a different identifier?  If I named
it "MyContact", would I then use 'MyContact' (note, no dots) in
createObject?

o If the provideClass causes a "factory component [to be] created
and registered", and the first arg of createObject controls where
the factory components are looked for, how does one control where
the factory component gets created?  Are we just talking about
the Module hierarchy here, and ob is Module?  (That doesn't seem
likely).

o If you just want the "first" factory to be used (whatever
that means), can you specify None for ob?

o The sample products.zcml entry has file="Contact.zcml".  Would
the example be better if it were file="Contacts/Contacts.zcml"?
I'm thinking that it is probably *not* desirable to have a .zcml
file for every component in the top level Zope3 directory, but that
these files would instead typically be in the module directory for
the component.  This would be doubly true for Product components.
If there's a reason for putting them all in the root, that should
be discussed.

o Speaking of location, if this PythonProgrammersTutorial is intended
as the beginning of the "end user developer" documentation (as
opposed to developer-ofZope3 documentation), which is my impression
of it's target audience, would it be better for the example component
to be placed in the Products directory?

o The tutorial tells you to install the products.zcml file (or edit
the existing one).  It does not tell you to create a Contact
directory under Zope and put the Contact.py and __init__.py file
there, but unless I missed something (I haven't been able to try
it yet) that step is also necessary.

--RDM