Changeset 4372 for waeup


Ignore:
Timestamp:
27 Jun 2009, 11:25:05 (15 years ago)
Author:
uli
Message:

Document/test department factory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-rewrite/src/waeup/university/department.txt

    r4327 r4372  
    105105        <waeup...certificatecontainer.CertificateContainer object at 0x...>
    106106
     107Utilities
     108=========
     109
     110:class:`DepartmentFactory`
     111--------------------------
     112
     113.. class:: DepartmentFactory()
     114
     115   .. attribute:: grok.name(u'waeup.Department')
     116
     117   .. attribute:: grok.implements(IFactory)
     118
     119   A named utility to deliver new instances of :class:`Department`
     120   without the need to import the implementation before:
     121
     122     >>> from zope.component import createObject
     123     >>> mydepartment = createObject(u'waeup.Department')
     124     >>> mydepartment
     125     <waeup.university.department.Department object at 0x...>
     126
     127   The factory complies with the specifications from the
     128   :class:`IFactory` insterface:
     129
     130     >>> from zope.interface.verify import verifyClass
     131     >>> from zope.component.interfaces import IFactory
     132     >>> from waeup.university.department import DepartmentFactory
     133     >>> verifyClass(IFactory, DepartmentFactory)
     134     True
     135
     136   This means also, that we can get the interfaces of the created
     137   object from the factory:
     138
     139     >>> department_factory = DepartmentFactory()
     140     >>> department_factory.getInterfaces()
     141     <implementedBy waeup.university.department.Department>
Note: See TracChangeset for help on using the changeset viewer.