O'Reilly logo

Professional Plone Development: Building robust, content-centric web applications with Plone 3, an open source Content Management System by Martin Aspeli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4. Describing Functionality with Interfaces

Thus far, we have described the core concepts of Zope 2 programming. The remainder of this chapter will focus on concepts that are new with Zope 3: interfaces, utilities, adapters, views, and events.

Interfaces are a key part of most Zope 3 techniques. They are best thought of as verifiable documentation—descriptions of components and their behavior that can be inspected at run time. The simplest form of an interface—known as a marker interface—is one that describes the type of a component without promising any methods or attributes.

Because Python does not have a language construct for interfaces, we define them using classes inheriting from zope.interface.Interface:

>>> from zope.interface import Interface ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required