When modeling design with interfaces, we should always endeavor to adhere to the principle of separation of concerns. A component, as described by an interface, should do one thing and one thing only, providing the minimum necessary operations (methods) and attributes (properties) to support that function.
In complex systems such as Plone, we often need to provide general functionality that can act on different types of objects. Continuing with our earlier examples, consider an instrument that is playable.
>>> class IPlayable(Interface): ... """An instrument that can be played ... """ ... ... def __call__(tune): ... """Play that tune! ... """
We may write some general code that expects an
IPlayable. An ...