[Framework-Team] Re: r15422 - in plone.transforms/trunk/plone/transforms: . interfaces tests

Wichert Akkerman wichert at wiggy.net
Thu Jun 21 18:57:09 UTC 2007


This looks like something that should be discussed on plone-developers,
not plone-framework...

Wichert.

Previously Daniel Nouri wrote:
> Hi Hanno!
> 
> hannosch wrote:
> > Added: plone.transforms/trunk/plone/transforms/interfaces/transform.py
> > ==============================================================================
> > --- (empty file)
> > +++ plone.transforms/trunk/plone/transforms/interfaces/transform.py	Wed Jun 20 21:18:48 2007
> > @@ -0,0 +1,22 @@
> > +from zope.interface import Attribute, Interface
> > +
> > +
> > +class ITransform(Interface):
> > +    """A transformation utility.
> > +    """
> > +
> > +    inputs = Attribute("List of mimetypes this transform accepts "
> > +                       "as inputs.")
> > +
> > +    output = Attribute("Output mimetype")
> > +
> > +
> > +    title = Attribute("The title of the transform.")
> > +
> > +    description = Attribute("A description of the transform.")
> > +
> > +    def convert(data, **kwargs):
> > +        """
> > +        The convert method takes some data in one of the input formats and
> > +        returns it in the output format.
> > +        """
> 
> Let me try and get a discussion started around this interface.
> 
> The 'convert' method doesn't say anything about what 'data' is supposed to
> be.  I think it's a good idea to require 'data' to be a file-like object
> from the start -- the same should go for the return value.  Also, I can't
> say I like the **kwargs.  Would you mind describing what that's for?
> 
> Generally, I think it's a good idea to make the interface specification as
> unambiguous as possible.  By saying 'some data' and not specifying what the
> keyword arguments are, I think we run into the danger of coupling clients
> with the transforms at a lower level than the interface.  Thus we lose real
> pluggability, because there's no exact specification and everyone can have
> their own interpretation of 'data' and 'kwargs'.
> 
> 
> Daniel
> 
> 
> _______________________________________________
> Framework-Team mailing list
> Framework-Team at lists.plone.org
> http://lists.plone.org/mailman/listinfo/framework-team

-- 
Wichert Akkerman <wichert at wiggy.net>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.




More information about the Framework-Team mailing list