ZopeInterfaces
Zope interface
Status: IsDraft
An interface is a description of the behavior of objects. Interfaces can be used to address a number of important needs:
- Specification: Interfaces specify the behavior of objects. Interfaces can be thought of as contracts for object behavior.
- Documentation: Interfaces document object behavior.
- Classification: Interfaces classify objects according to behavior. Objects that have the same interfaces can be used the same way.
- Type safety: Type checking facilities can check whether objects have compatible interfaces.
Zope provides objects for representing interfaces and a facility for declaring that objects provide interfaces. Interface objects were added to Zope for specification and documentation purposes, as described at: http://www.zope.org/Wikis/Interfaces . The page http://www.zope.org/Wikis/Interfaces/InterfaceUserDocumentation describes how to use Zope interfaces.
The Zope ComponentArchitecture uses interfaces primarily for classification and for connecting components based on compatible interfaces. Future versions of Zope may utilize interfaces for type safety, as part of the security system.
Python interface objects were proposed at the "Developer's Day" of the Seventh International Python Conference. The OriginalDevelopersDayProposal provided a high-level rationale for adding interfaces to Python.
