Make zope.app smaller
PackageGeddon Directors Cut
| Author: | Philipp von Weitershausen, philikon@philikon.de |
|---|---|
| Status: | IsProposal |
| Version: | 2 |
| Date: | $Date: 2006-04-07 17:54:00 +0200 (Fri, 07 Apr 2006) $ |
| Original: | $URL: http://codespeak.net/svn/user/philikon/MakeZopeAppSmaller.txt $ |
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 action mentioned here is proposed to be executed for Zope 3.3 with the proper backward compatibility for 12 months (corresponding Zope 3.5).
Simple renames
- zope.app.datetimeutils
Description: Utility functions for dealing with datetimes Dependencies: None Usage in Five: time (parse datetime from string) Proposed action: Rename to zope.datetime Implementation status: Done (jim-adapter branch) - zope.app.decorator
Description: Decorator implementation based on proxies Dependencies: None Usage in Five: Indirectly, via dependency from zope.app.location Proposed action: Rename to zope.decorator Implementation status: Done (jim-adapter branch) - zope.app.size
Description: Size display and sorting adapter Dependencies: None Usage in Five: Interfaces, helper functions Proposed action: Rename to zope.size Implementation status: Done (jim-adapter branch) - zope.app.traversing
Description: Traversing machinery (interfaces, namespace adapters, default traversers, absolute URL) Dependencies: zope.app.publisher (applySkin), zope.app.applicationcontrol, various testing dependencies Usage in Five: Interfaces (and default traverser, though that doesn't have to be used, really) Proposed action: Rename to zope.traversing (applySkin will be made available via zope.publisher.browser). Implementation status: Done (jim-adapter branch). Still depends on certain zope.app packages, though. - zope.app.location
Description: Locate objects in a hierarchy Dependencies: zope.app.decorator, zope.app.traversing, zope.app.component (ISite?) Usage in Five: interfaces Proposed action: Rename to zope.location Implementation status: Done (jim-adapter branch) - zope.app.annotation
Description: Annotation framework, incl. attributes storage Dependencies: None Usage in Five: indirectly (dependencies from other zope.app packages, 3rd party packages that use Five) Proposed action: Rename to zope.annotation. Implementation status: Done (jim-adapter branch) - zope.app.dublincore
Description: DublinCore? metadata adapters Dependencies: zope.app.annotation, zope.app.location, zope.app.event Usage in Five: indirectly (3rd party packages that use Five) Proposed action: Rename to zope.dublincore 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.copypastemove
Description: Adapters for copying/paste and moving objects between containers Dependencies: zope.app.annotation, zope.app.container, zope.app.event Usage in Five: indirectly (3rd party packages that use Five) Proposed action: Rename to zope.copypastemove Implementation status: None - zope.app.mail
Description: Send mail Dependencies: zope.app.schema (IVocabularyFactory?), zope.app.component (UtilityVocabulary?) Usage in Five: indirectly (3rd party packages that use Five) Proposed action: Rename to zope.sendmail Implementation status: None - zope.app.rdb
Description: Relational database connectivity Dependencies: zope.app.container Usage in Five: indirectly (3rd party packages that use Five) Proposed action: Rename to zope.rdb. 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 - 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
Cherry picking
- zope.app.event
Description: Object events Dependencies: None Usage in Five: Almost everything Proposed action: Move IObjectEvent?, dispatcher, etc. to zope.component. Move the rest to zope.lifecycleevent Implementation status: Almost done (jim-adapter branch); need to move 1 test case and 1 ZCML file. - zope.app.exception
Description: Definition of UserError?, browser views for various exceptions Dependencies: zope.app.pagetemplate (ViewPageTemplateFile?) Usage in Five: UserError? Proposed action: Move exceptions and interfaces to zope.exceptions. Implementation status: Done (jim-adapter branch) - zope.app.publication
Description: The zope.app default publications Dependencies: irrelevant Usage in Five: setDefaultSkin Proposed action: Move setDefaultSkin to zope.publisher.browser. Implementation status: Done (jim-adapter branch) - 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 BrowserView? and applySkin to zope.publisher.browser, move menu support to zope.menu, move ZCML directive handlers etc. to zope.browserzcml Also proposed: Rename zope.formlib.page.Page to zope.publisher.browser.BrowserPage?, alongside BrowserView? Implementation status: applySkin and BrowserView? done (jim-adapter branch) - zope.app.schema
Description: Vocabulary support, persistent schemas Dependencies: Various Usage in Five: Vocabulary support (IVocabularyFactory?) Proposed action: Move IVocabularyFactory? to zope.schema.interfaces. Implementation status: Done (jim-adapter branch) - 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, XXX move local site machinery to zope.site???, - zope.app.i18n
Description: I18n for zope.app, specifically persistent message catalogs Dependencies: Various Usage in Five: ZopeMessageFactory?, ZCML handler Proposed action: Move ZCML handler out to zope.i18n.zcml; ZopeMessageFactory? can easily be created individually as needed - 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.
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? - 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 - 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). - 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). - 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!
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
Several items have been implemented on the jim-adapter branch.
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.
