[Zope-Checkins] CVS: Zope3/lib/python/Zope/ComponentArchitecture - IComponentArchitecture.py:1.1.2.9
Jim Fulton
jim@zope.com
Sun, 6 Jan 2002 18:37:46 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/ComponentArchitecture
In directory cvs.zope.org:/tmp/cvs-serv7790
Modified Files:
Tag: Zope-3x-branch
IComponentArchitecture.py
Log Message:
Factored IComponentArchitecture into service interfaces
=== Zope3/lib/python/Zope/ComponentArchitecture/IComponentArchitecture.py 1.1.2.8 => 1.1.2.9 ===
+#
+# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
+#
# This software is subject to the provisions of the Zope Public License,
-# Version 1.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-
-from Interface import Interface
-
-class IComponentArchitecture(Interface):
-
- def provideAdapter(forInterface, providedInterface, maker):
- """Provide an adapter
-
- An adapter provides an interface for objects that have another
- interface.
-
- Arguments:
-
- forInterface -- The interface the adapter provides an interface for.
-
- providedInterface -- The provided interface
-
- maker -- a callable object that gets an adapter component for
- a context component.
- """
-
- def getAdapter(object, interface, default=None):
- """Look up an adapter that provides an interface for an object
-
- The object also provides a place to look for placeful adapters.
-
- A Zope.ComponentArchitecture.ComponentLookupError will be
- raised if the component can't be found.
- """
-
- def provideUtility(providedInterface, component):
- """Provide a utility
-
- A utility is a component that provides an interface.
- """
-
- def getUtility(object, interface, default=None):
- """Look up a utility that provides an interface
-
- The object provides a place to look for placeful adapters.
-
- A Zope.ComponentArchitecture.ComponentLookupError will be
- raised if the component can't be found.
- """
-
- def provideView(forInterface, name, type, maker):
- """Provide a view
-
- A view provides some type of presentation (e.g. browser, ftp)
- for components of a given interface.
-
- Arguments:
-
- forInterface -- The interface the view is for
-
- name -- The view name
-
- type -- The view type, expressed as an interface
-
- maker -- a callable object that gets a view component for
- a context component.
- """
-
- def getView(object, name, type, default=None):
- """Look up a named view of a given type for an object
-
- The type is expressed as an interface.
-
- The object also provides a place to look for placeful views.
-
- A Zope.ComponentArchitecture.ComponentLookupError will be
- raised if the component can't be found.
- """
-
- def provideFactory(name, factory):
- """Provide a factory for the given name.
- """
-
- def createObject(object, name):
- """Create a new object using the factory with the given name
-
- The object provides a place to look for placeful views.
-
- A Zope.ComponentArchitecture.ComponentLookupError will be
- raised if the factory component can't be found.
- """
-
- def defineService(name, interface):
- """Define a new service"""
-
- def provideService(name, component):
- """provide a service implementation"""
-
- def getService(object, name):
- """retrieve a service implementation"""
-
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
+"""
+
+Revision information: $Id$
+"""
+
+from IServiceService import IServiceService
+from IViewService import IViewService
+from IAdapterService import IAdapterService
+from IUtilityService import IUtilityService
+from IFactoryService import IFactoryService
+
+class IComponentArchitecture(IServiceService, IViewService, IAdapterService,
+ IUtilityService, IFactoryService):
+ """The Component Architecture is defined by the five key services.
+ """