[Zope3-Users] Re: View or content provider

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Jul 17 15:03:33 EDT 2007

On Tuesday 17 July 2007 14:28, Daniel Nouri wrote:
> plone.portlets introduces some two dozen (!) interfaces/concepts on top of
> viewlets in order to implement the flexibility that it needs.  E.g. it
> introduces an 'available' method/property that controls visibility, which
> viewlets by themselves lack.  I imagine I could do this with less overhead
> without viewlets (see my other mail), or IOW: viewlets don't seem
> inherently flexible to me.

Then you do not understand them. They are inherently flexible because content 
providers are multi-adapters of context, request, and view and viewlets are 
multi-adapters of context, request, view, and viewlet manager. Using adapted 
objects as discriminators has opened totally new ways of developing UI 
patterns in Zope 3. We have heavily learned from using those patterns and I 
think the new z3c.form* framework benefitted a lot from it.

As to portlets. When talking about portlets, the Web community refers usually 
to features described in JSR 168. Viewlets have absolutely no ambition to 
come even close to this. In fact, we specifically designed viewlets to do 
much less with the intend to later implement portlets on top of them.

To you viewlets might look extremely simple, in idea and implementation. But 
this did not come over night and we said: Oh cool, let's use a 
triplet-adapter to do content providers. Roger and I did an independent 
implementation of viewlets, then fiercly discussed for nearly a week (people 
attending the Tuebingen sprint can attest to this) the design goals and 
implementation. The simple design of both, content provider and viewlets, is 
thus a result of a deep understanding of UI development problem, not 
something that was thrown together quickly. You know, often less is more!

As to plone.portlets, I think they are heavily overengineered. Last time I 
looked at its API, it was heavily bloated. This might be a result of being a 
Plone package though, I do not know, but I would certainly implement them 
much slimmer. 

Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training

More information about the Zope3-users mailing list