plone.behavior (1.0)
- plone.behavior download link: http://pypi.python.org/packages/source/p/plone.behavior/plone.behavior-1.0b4.tar.gz#md5=8f410e89747f4a8e762c962c0f97aa23
- Homepage of plone.behavior: http://pypi.python.org/pypi/plone.behavior
- Description source: http://pypi.python.org/pypi/plone.behavior
This package provides optional support for "behaviors". A behavior is a re-usable aspect of an object that can be enabled or disabled without
changing the component registry.
A behavior is described by an interface, and has metadata such as a title and a description. The dotted name of the interface is the unique name for the behavior, from which the metadata can be looked up. When the behavior is enabled for an object, you will be able to adapt the object to the interface. In some cases, the interface can be used as a marker interface as well.
As an example, let's say that your application needs to support object-level locking, and that this can be modeled via an adapter, but you want to leave it until runtime to determine whether locking is enabled for a particular object. You could then register locking as a behavior.