[Grok-dev] could we re-name grok.IRESTRequest to grok.IRESTLayer?

Brandon Craig Rhodes brandon at rhodesmill.org
Wed Dec 17 10:16:17 EST 2008

I understand that whoever wrote the following definition in
`grok.interfaces` was doing something that looks quite reasonable; the
superclass is a Request-thing, so shouldn't the class also indicate that
in its name::

    class IRESTRequest(IHTTPRequest):
        """REST-specific Request functionality.

        Base Interfaces for defining REST-layers.

But the way that an `IRESTRequest` is actually used, always, and in
every context that I can find it used, is as a base class for a REST
layer.  Therefore, I think that it should be renamed to `IRESTLayer`,
and that `IRESTRequest` should be left around as a synonym to avoid
breaking old code that has already used that name - but that the name
should be put through deprecation, either now, or some time after 1.0.

This would mean that definitions like the following one, from the file

    class LayerC(grok.IRESTRequest):

would become the much more sensible::

    class LayerC(grok.IRESTLayer):

Brandon Craig Rhodes   brandon at rhodesmill.org   http://rhodesmill.org/brandon

More information about the Grok-dev mailing list