[Checkins] SVN: zope.component/branches/tseaver-wo_zope_deferred/src/zope/component/interfaces.py Un-deprecate the 'bbb/interfaces' names.

Tres Seaver tseaver at palladion.com
Tue Mar 3 17:34:43 EST 2009


Log message for revision 97466:
  Un-deprecate the 'bbb/interfaces' names.

Changed:
  U   zope.component/branches/tseaver-wo_zope_deferred/src/zope/component/interfaces.py

-=-
Modified: zope.component/branches/tseaver-wo_zope_deferred/src/zope/component/interfaces.py
===================================================================
--- zope.component/branches/tseaver-wo_zope_deferred/src/zope/component/interfaces.py	2009-03-03 21:55:37 UTC (rev 97465)
+++ zope.component/branches/tseaver-wo_zope_deferred/src/zope/component/interfaces.py	2009-03-03 22:34:43 UTC (rev 97466)
@@ -15,6 +15,7 @@
 
 $Id$
 """
+__docformat__ = "reStructuredText"
 
 from zope.interface import Attribute
 from zope.interface import Interface
@@ -908,3 +909,75 @@
 class IComponents(IComponentLookup, IComponentRegistry):
     """Component registration and access
     """
+
+
+class IContextDependent(Interface):
+    """Components implementing this interface must have a context component.
+
+    Usually the context must be one of the arguments of the
+    constructor. Adapters and views are a primary example of context-dependent
+    components.
+    """
+
+    context = Attribute(
+        """The context of the object
+
+        This is the object being adapted, viewed, extended, etc.
+        """)
+
+
+class IPresentation(Interface):
+    """Presentation components provide interfaces to external actors
+
+    The are created for requests, which encapsulate external actors,
+    connections, etc.
+    """
+
+    request = Attribute(
+        """The request
+
+        The request is a surrogate for the user. It also provides the
+        presentation type and skin. It is of type
+        IPresentationRequest.
+        """)
+
+
+class IPresentationRequest(Interface):
+    """An IPresentationRequest provides methods for getting view meta data."""
+
+
+class IResource(IPresentation):
+    """Resources provide data to be used for presentation."""
+
+
+class IResourceFactory(Interface):
+    """A factory to create factories using the request."""
+
+    def __call__(request):
+        """Create a resource for a request
+
+        The request must be an IPresentationRequest.
+        """
+
+
+class IView(IPresentation, IContextDependent):
+    """Views provide a connection between an external actor and an object"""
+
+
+class IViewFactory(Interface):
+    """Objects for creating views"""
+
+    def __call__(context, request):
+        """Create an view (IView) object
+
+        The context aregument is the object displayed by the view. The
+        request argument is an object, such as a web request, that
+        "stands in" for the user.
+        """
+
+class IDefaultViewName(Interface):
+    """A string that contains the default view name
+
+    A default view name is used to select a view when a user hasn't
+    specified one.
+    """



More information about the Checkins mailing list