[Zope3-Users] Re: File structure: interface and interfaces

George Lee georgeleejr at gmail.com
Tue Sep 26 10:03:56 EDT 2006


Philipp von Weitershausen <philipp at ...> writes:

> 
> George Lee wrote:
> > What is the best practice for where to put interface definitions? Inside an
> > interfaces.py, a browser/interfaces.py?
> 
> We prefer to put public interfaces into package.interfaces. Other 
> modules can also define interfaces, but they wouldn't be considered to 
> be part of a public API.
> 
> > In Zope2 often I had used an "interfaces" (with an s) directory. Should a
> > directory be called "interface" instead, as it is in zope.app?
> 
> zope.app.interface is about interface support, like zope.interface. 
> They're don't as much contain interfaces as they provide machinery for them.
> 


Looking closer at a recent version of Archetypes, I realize that "interfaces.py"
is a legacy module used to define Zope2 interfaces, while the fodler "interface"
stores Zope3 interfaces.

Lesson: Use an "interfaces" folder for Zope3 interfaces; in the rare case you
need to keep "interfaces.py" for Zope2 interfaces, use an "interface" folder.

Peace,
George



More information about the Zope3-users mailing list