[Zope3-dev] RFC - Implement Views As Adapters
Shane Hathaway
shane at hathawaymix.org
Wed Jun 16 01:32:12 EDT 2004
On Tuesday 15 June 2004 12:24 pm, Jim Fulton wrote:
> At:
>
> http://dev.zope.org/Zope3/ImplementViewsAsAdapters
>
> I've written a proposal for simplifying the way we create views
> by modeling skins and layers as marjer interface and then using
> standard adapters. This eleiminates the need for the presentation
> service and the specialized view APIs. It also provide some performance
> improvement, although I don't know whether it is significant.
>
> Comments are welcome. I'd like to implement this for X3.1.
This sounds like an excellent way to rework views. In my view, skins serve
two primary purposes: to customize the appearance of an application, and to
vary appearance depending on who is coming in and how. Since we can already
customize applications using the Zope 3 configuration machinery, one of the
needs for skins has already dropped out, IMHO. Varying the appearance
depending on who and how can be addressed well by your proposal. I envision
people defining IGuestBrowserRequest, IAdministratorBrowserRequest,
IExtranetBrowserRequest, ITinyScreenBrowserRequest, etc. (That might lead to
wild interface combinations like
IAdministratorUsingATinyScreenOnTheExtranetBrowserRequest, but hopefully no
one ever actually has to write that interface. :-) )
However, you're suggesting this for a minor version upgrade. In a minor
version upgrade, you're allowed to change configuration file formats. In the
interest of keeping Zope 3 simpler overall, I suggest that ZCML should just
remove the former concepts of skins and layers. Then the X3.0 -> X3.1
upgrade guide should point to your proposal.
Shane
More information about the Zope3-dev
mailing list