[Zope3-dev] separation of view hierarchy

Jim Fulton jim@zope.com
Sat, 14 Dec 2002 08:33:40 -0500


Florent Guillaume wrote:
>>>My big problem at the moment with ProposedDirectoryHierarchy is the
>>>removal of the View package. If we only have zope.app.browser instead of
>>>zope.app.view.browser, there's absolutely no way to factor out code
>>>that's specif to views but not specific to browsers. For instance
>>>sorting of folder contents, helper formatting functions, and so on.
>>>
>>Sorting would not be considered a View, but an Adapter functionality and 
>>should be located with the actual folder code.
>>
> 
> Huh? Why is that?
> Sorting is only done for display purposes and has nothing to do with
> the functionning of the folder. The convenience of sorting a specialized
> list of dicts containing dates in a certain format, for instance, has
> nothing to do in the actual folder code IMO.

You are right, it has nothing to do with folder code, so it shouldn't be in
the folder class. It also doesn't have anything to do with a particular presentation
type (ui framework or protocol), so it doesn't belong in view code.

Sorting is really application functionality,so it should be in an application-functionality
component, such as an adapter or utility.

Jim

-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (888) 344-4332            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org