Make zope.app smaller (a.k.a. PackageGeddon2) ============================================= or == PackageGeddon Directors Cut =========================== :Author: Philipp von Weitershausen, philikon@philikon.de :Status: IsProposal :Version: 4 :Date: $Date$ :Original: $URL$ Current situation ----------------- zope.app contains roughly 90 subpackages. Only a fraction of them are essential to the Zope 3 application server which is what zope.app is supposed to contain. Many packages can be and *are* reused in other systems, most importantly the Zope 2 application server. Problem ------- In order not to duplicate code, systems like Zope 2 have to include zope.app and, therefore, everything that zope.app depends on as well. For example, Zope 2 includes zope.app.twisted and would theoretically have to include twisted as well, even though it does not use Twisted at all. Goal ---- The **long-term goal** is to make zope.app smaller so that it only contains things vital to the Zope 3 application server. Essentially, this would be zope.app.appsetup, zope.app.twisted, zope.app.server and zope.app.publication. The rest could probably be used outside of Zope 3, for example in Zope 2 or in a Zope 3 "basket technology" product that doesn't use the app server but Zope 3 technology. Making zope.app smaller essentially means moving packages down from zope.app to zope. Since Zope 2 is a strong motivator for this, this proposal starts with those zope.app subpackages that Zope 2 depends on. That way, Zope 2 won't have to include zope.app anymore in the future. This is the **short-term goal** and the aim of this proposal. Proposal -------- The packages identified as being used in Zope 2/Five are listed below in three categories. For packages in the **Simple renames** and **Cherry picking** categories, concrete actions are proposed here. The rest of the packages are filed under **Complicated cases** and are to be dealt with at a later time. **Note:** Any changed mentioned below is proposed to be implemented in Zope 3.4 with the proper backward compatibility for 12 months (corresponding to Zope 3.6). XXX todo ~~~~~~~~ deprecate localUtility directive queryType -> zope.interface UtilityVocabulary -> zope.component.vocabulary? * zope.traversing depends on zope.app.applicationcontrol; it also depends on lots of zope.app packages for testing * zope.dublincore depends on zope.app.testing.placefulsetup * zope.copypastemove depends on zope.app.principalannotation, zope.app.testing.placefulsetup * zope.app.event still contains a test case (XXX) and a configure.zcml file (should be moved to zope.component/event.zcml) Simple renames ~~~~~~~~~~~~~~ zope.app.container :Description: Container functionality (interfaces, events, helpers, sample implementations, browser views) :Dependencies: zope.app.event, zope.app.exception, zope.app.location, zope.app.broken (IBroken), zope.app.dependable, zope.app.size, zope.app.traversing :Usage in Five: Interfaces, events :Proposed action: Rename to zope.container. Move code dependent on zope.app.dependable out to zope.app.dependable. Persistency BBB has to be dealt with (for {BTree|Ordered}Container and ContainedProxy)! :Implementation status: None zope.app.cache :Description: Caching framework, several cache implementations :Dependencies: zope.app.annotation, zope.app.schema (IVocabularyFactory), zope.app.component (UtilityVocabulary), zope.app.container (contained), zope.app.form (widgets), zope.app.publisher (BrowserView) :Usage in Five: indirectly (3rd party packags that use Five) :Proposed action: Rename to zope.cache :Implementation status: None zope.app.keyreference :Description: Key reference framework, with adapter for persistent objects :Dependencies: None :Usage in Five: None :Proposed action: Rename to zope.keyreference :Implementation status: None Cherry picking ~~~~~~~~~~~~~~ zope.app.publisher :Description: Publishing aids such as resources, ZCML view directive handlers, browser menus :Dependencies: Various :Usage in Five: Resources, ZCML directive handlers, menu machinery :Proposed action: Move menu support to zope.menu, move ZCML directive handlers etc. to zope.browserzcml :Implementation status: None zope.app.component :Description: Local component registries, component look-up hook, ZCML directives handlers for elementary directives :Dependencies: Various :Usage in Five: ZCML directive helpers, local site machinery (ISite, subscribers, lookup hooks, etc.) :Proposed action: Move ZCML stuff to zope.component.zcml, Move local site machinery to zope.site :Implementation status: ZCML in Zope 3.3, site machinery not done zope.app.broken :Description: Represent broken objects in the ZODB :Dependencies: zope.app.location, zope.app.annotation, zope.app.appsetup (IDatabaseOpenedEvent) :Usage in Five: dependency on IBroken from zope.app.container :Proposed action: Move IBroken out to ZODB.interfaces. :Implementation status: None Complicated cases (not dealt with in this version of the proposal) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ zope.app.security :Description: Various security helpers, ZCML directives :Dependencies: Various :Usage in Five: checkPermission, ZCML directive handlers and field :Proposed action: XXX merge parts of this with zope.security? :Implementation status: None zope.app.pagetemplate :Description: PageTemplates support for zope.app (TALES engine, trusted/untrusted ZPTs) :Dependencies: zope.app.traversing, zope.app.dublincore :Usage in Five: ViewPageTemplateFile & Co. :Proposed action: XXX :Implementation status: None zope.app.form :Description: Automatically generated forms :Dependencies: Various :Usage in Five: Interfaces, base class, ZCML directive handlers, widgets, helpers :Proposed action: Deprecate zope.app.form in the long term, move widgets and helpers out to zope.widget (as suggested by Martijn Faassen). :Implementation status: None zope.app.locales :Description: Translation string extractor, Zope 3 translations :Dependencies: None :Usage in Five: extractor, translations :Proposed action: For now, move out only the extractor (to zope.i18n). :Implementation status: None zope.app.intid :Description: Integer IDs :Dependencies: zope.app.container, zope.app.keyreference, zope.app.location, zope.app.testing (functional), zope.app.component (hook for testing) :Usage in Five: None :Proposed action: XXX rename to zope.intid??? what happens with the ftest? Persistency BBB has to be dealt with! :Implementation status: None Things not to move ~~~~~~~~~~~~~~~~~~ zope.app.testing :Description: Various test fixtures :Dependencies: Various :Usage in Five: placelesssetup :Proposed action: Evaluate Five's usage of placelesssetup; possibly setup/teardown from zope.component is enough zope.app.zapi :Description: Convenience import for common Zope API functions :Dependencies: Various :Usage in Five: Various :Proposed action: Stop using zapi. Risks ----- None identified. Implementation status --------------------- None so far. Implemented in Zope 3.3 ~~~~~~~~~~~~~~~~~~~~~~~ Parts of earlier versions of this proposal have already been implemented in Zope 3.3. The following packages were moved without changes out of zope.app: zope.app.datetimeutils -> zope.datetime :Description: Utility functions for dealing with datetimes :Usage in Five: time (parse datetime from string) zope.app.decorator -> zope.decorator :Description: Decorator implementation based on proxies :Usage in Five: Indirectly, via dependency from zope.app.location zope.app.size -> zope.size :Description: Size display and sorting adapter :Usage in Five: Interfaces, helper functions zope.app.location -> zope.location :Description: Locate objects in a hierarchy :Dependencies: zope.app.component (ISite) :Usage in Five: interfaces zope.app.annotation -> zope.annotation :Description: Annotation framework, incl. attributes storage :Usage in Five: indirectly (dependencies from other zope.app packages, 3rd party packages that use Five) zope.app.dublincore -> zope.dublincore :Description: DublinCore metadata adapters :Usage in Five: indirectly (3rd party packages that use Five) zope.app.copypastemove -> zope.copypastemove :Description: Adapters for copying/paste and moving objects between containers :Usage in Five: indirectly (3rd party packages that use Five) zope.app.mail -> zope.sendmail :Description: Send mail :Dependencies: zope.app.component (UtilityVocabulary) :Usage in Five: indirectly (3rd party packages that use Five) zope.app.rdb -> zope.rdb :Description: Relational database connectivity :Usage in Five: indirectly (3rd party packages that use Five) zope.app.contenttypes -> zope.contenttype :Description: Content/MIME type detection :Usage in Zope 2: Replacement for OFS.content_types zope.app.filerepresentation -> zope.filerepresentation :Description: File representation interfaces :Usage in Zope 2: Indirectly zope.app.traversing -> zope.traversing :Description: Traversing machinery (interfaces, namespace adapters, default traversers, absolute URL) :Usage in Five: Interfaces (and default traverser, though that doesn't have to be used, really) The following components were moved out of their zope.app packages (without moving the whole package): zope.app.event IObjectEvent and the object event dispatcher were moved to zope.component. IObjectCreatedEvent, IObjectCopiedEvent, IObjectModifiedEvent (and their interfaces) were moved to zope.lifecycleevent. zope.app.exception.interfaces IUserError and UserError were moved to zope.exceptions. zope.app.publication.browser setDefaultSkin was moved to zope.publisher.browser zope.app.schema.vocabulary IVocabularyFactory was moved to zope.schema.interfaces zope.app.i18n.meta* ZCML machinery for registering gettext catalogs as translation domains was moved to zope.i18n.zcml. zope.app.publisher.browser BrowserView and applySkin were moved to zope.publisher.browser. zope.formlib Page was moved and renamed to zope.publisher.browser.BrowserPage Changes in Version 4 -------------------- * Moved those items that have been implemented for Zope 3.3 (formerly implemented on jim-adapter branch) out of the proposal section. Changes in Version 3 -------------------- * Updated implementation status of items that have been finished (on the jim-adapter branch). * Decided what to do with site machinery in zope.app.component (move to zope.site). * Added zope.app.contenttypes, zope.app.filerepresentation to the list. Changes in Version 2 -------------------- * Added zope.app.dublincore, zope.app.cache, zope.app.copypastemove, zope.app.mail, zope.app.rdb, zope.app.locales to the list. * Changed proposed action for zope.app.event: Split it between zope.component.event and zope.lifecycleevent. * Reclassified zope.app.i18n and added proposal to move out the ZCML handler to zope.i18n.zcml. * Decided where to put browser ZCML directives (zope.browserzcml) and menu support (zope.menu). * Decided where to put component architecture ZCML directives (zope.component.zcml). * Decided what to do with zope.app.broken (move out IBroken to ZODB.interfaces). * Decided what to do about zope.app.container's dependency on zope.app.dependable and reclassified it. * Added rather unrelated proposed action to zope.app.publisher entry: Move zope.formlib.page.Page to zope.publisher.browser.BrowserPage. * Updated implementation status of items that have been finished (on the jim-adapter branch). * Various minor updates regarding dependency information.