[Zope-CMF] making CMFCore independent from CMFDefault

Tres Seaver tseaver@zope.com
21 Nov 2002 11:10:45 -0500


On Thu, 2002-11-21 at 09:56, Yuppie wrote:
> Hi!
> 
> This mail is not about *why*, its about *how* to do this.
> 
> If you are interested in the *why*, have a look at these two mails:
>   <http://lists.zope.org/pipermail/zope-cmf/2002-October/015632.html>
>   <http://lists.zope.org/pipermail/zope-cmf/2002-October/015939.html>
> 
> For background information, I'll start with an ASCII-table that shows 
> some dependencies between CMFCore and CMFDefault. It lists interfaces 
> (most of them for the tools) and the corresponding implementations. 
> Modules in '()' don't refer explicit to an interface, but I hope the 
> classifications are correct.
> 
> 
> CMF Interfaces            | CMFCore               | CMFDefault
> --------------------------+-----------------------+-------------------
> CachingPolicyManager      | CachingPolicyManager  |  --
> ContentTypeRegistry       | (ContentTypeRegistry) |  --
> Contentish                | PortalContent         |  --
> Discussions               |  --                   |  --
> DublinCore                |  --                   | DublinCore
> IndexableContent          | (PortalContent)       |  --
> Membership                |  --                   |  --
> PortalContentRegistration | (register)            |  --
> ReviewableContent         | (PortalContent)       |  --
> Syndicatable              |  --                   | (SyndicationTool)
> portal_actions            | ActionsTool           |  --
> portal_catalog            | CatalogTool           |  --
> portal_discussion         | DiscussionTool        ? DiscussionTool
> portal_memberdata         | MemberDataTool        |  --
> portal_membership         | MembershipTool        > MembershipTool
> portal_metadata           |  --                   | (MetadataTool)
> (portal_properties)       |  --                   | PropertiesTool
> portal_registration       | RegistrationTool      > RegistrationTool
> portal_skins              | SkinsTool             |  --
> portal_types              | (TypesTool)           |  --
> portal_undo               | UndoTool              |  --
> (portal_url)              |  --                   | URLTool
> portal_workflow           | WorkflowTool          |  --
> 
> 
> 
> And now some initial thoughts:
> 
> 1.) Info: I already started moving CMFDefault.URLTool to CMFCore.

That is fine.

> 2.) Proposal: move CMFDefault.DublinCore to CMFCore
>      Why: CMFWorkspaces, CMFWiki, CMFCollector and CMFCalendar depend
>      on DublinCore.

-1.  I'm not *that* happy with the current 'DefaultDublinCoreImpl', and
would rather not promulgate its use.  If we *do* need to add an
implementation of the DublinCore interfaces to the core, it should be
one which indirects all knowlege of how the values are stored through
the tool.  E.g.:

  class AnnotatedDublinCore:

      def _getTool( self ):
          return getToolByName( self, 'portal_metadata' )

      def Title( self ):
          return self._getTool().getSchemaProperty( self, 'DC', 'Title')

etc.  Christian Theune's "flexible metadata" patch moves in this
direction, I think.

> 3.) Proposal: remove Syndicatable interface from CMFDefault.Interfaces
>      Why: redundant

Hmm, I think it would make more sense to move the interface, the tool,
and the related skins into a separate product;  RSS syndication isn't
(quite) universal enough to be a "core" service.  I guess I could live
with having the interface in CMFCore.

> 4.) Question: CMFCore.ActionsTool depends on CMFDefault.PropertiesTool
>      and CMFDefault.SyndicationTool. What to do?

Nothing.  The dependency is not on those modules, but on having tools
which implement the specified interfaces.  This "dependency" is solely
in the "default" configuration of the actions tool;  one could argue
that the tool shouldn't know about *any* initial configuration, and move
the responsibility for creating it to the "site setup" factory / tool.

> 5.) Proposal: remove Discussions and Membership interface from
>      CMFCore.Interfaces
>      Why: They seem to be replaced by newer interfaces and not used
>      anymore.

It might be better to update the interfaces in the 'Discussions' module
to reflect the current state of DiscussionItem;  these interfaces
*don't* overlap the "discussions tool" interface.  Likewise, the
'Membership' module defines out-of-date interfaces for Member (this one
should probably be updated) and the MemberFolder (probably defunct).

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com