[Zope3-dev] Bringing the name game to a close, for now

Jim Fulton jim@zope.com
Mon, 17 Dec 2001 16:00:43 -0500


Martijn Faassen wrote:
> 
> Jim Fulton wrote:
> > Lennart Regebro wrote:
> > >
> > > From: "Guido van Rossum" <guido@python.org>
> > > > I like adapter a lot better than feature.  And I think it's
> > > > appropriate: an adapter can convert an application protocol (like the
> > > > "Contact" class in Jim's tutorial) into a presentation protocol like
> > > > HTML.  Whether that is new functionality or not is in the eye of the
> > > > beholder...
> > >
> > > Well, you are correct, that would be a kind of adapter. But this sounds to
> > > me more like a presentation component, and not like a feature component.
> >
> > Right you are!
> 
> Hmm.. Can't presentation components be adapter components at the same time?
> The interface they're adapting to may be straight HTML and HTTP, but as
> Zope has shown this can be treated as methods and objects, after all..
> 
> This is what ParsedXML's manageable wrappers do; they're adapters
> (or actually decorators, they *add* manageable methods to the existing
> DOM defined ones). ParsedXML's manageable wrappers are also view
> components however (the methods added provide things like ZMI manageability
> and traversability to the nodes).
> 
> I really want to be able to use adapters/decorators in this way!

Maybe it would be useful to separate your wrappers into multiple
separet adapters and views.  For example, ZMI support should be factored into 
separate components from DOM support. 

I suspect that there will be cases where the distinction between 
adapters and views is not crisp.  Perhaps the view concept generalizes
the adapter concept.  Certainly, if view names are not used (e.g. all 
views of a type have the same name), then the difference between adapter and
view will only be a difference of intent.

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