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

Jan-Wijbrand Kolman janwijbrand at gmail.com
Tue Dec 30 13:55:09 EST 2008


(trying to draw a conclusion here; I'd like to close the issue).

> We do need the symmetry.
> 
> I'm leaning slightly in favor of having a IViewLayer and a IRESTLayer, 
> as opposed to IBrowserRequest and IRESTRequest. IViewLayer would be a 
> simple subclass of IBrowserRequest. I think "View" is better than 
> "Browser" too - these are layers people use for their views.

Renaming "IBrowserRequest to "IViewLayer" is not so simple in that it is
implemented in grokcore.view which is beyond 1.0 for a while now. So, I
think we'd need a proper deprecation warning for that.

Unless we'd opt for introducing IViewLayer in grok itself.

> I think this naming discussion shows that exposing the request-like 
> nature of layers confuses here as much as it might enlighten. I think 
> it's clearer for people to think: "I'm going to make a layer here for my 
> views, and I need to subclass it from grok.interfaces.IViewLayer" and 
> aren't distracted by how this works internally. That knowledge may be 
> *useful* but it's not essential to an understanding how layers behave 
> either.

IMHO it is useful knowledge up to the point it is required knowledge - I
only fully understood layering and skinning once I understood your
really replacing the interface the request provides when applying a
skin. But I digress.


With a bit of reluctance, my proposal in an attempt to draw a conclusion
and close the issue would be to:

  * Rename IRESTRequest into IRESTLayer

  * Add IViewLayer to grokcore.view.interface like so...

      IViewLayer = IBrowserRequest

    ...in order to keep backwards compatibility.

  * Change the docs in grokcore.view (and grok) in order to explain to
    use IViewLayer as a baseclass for layers.

Ok?


regards,
jw



More information about the Grok-dev mailing list