[Zope3-dev] Re: Container interface issues

Fred L. Drake, Jr. fred at zope.com
Wed Sep 10 14:47:47 EDT 2003


Garrett Smith writes:
 > If developers are adding things to containers this way, my guess is that 
 > they're well on their way to working with specific interfaces and using 
 > adapters.

That's not the issue.  The point of moving this particular invocation
to a helper function exposed (wherever) is to ensure that it's spelled
the same way every time, and to move a common(?) set of steps out of
the application-centric code.  The specific interfaces here aren't
likely to change or be used for much else (I'm thinking of things like
IAddTarget), so it makes sense to move this out of the application,
which should be concerned with more application-specific operations.

 > This is probably a matter of personal preference, but I'm much happier 
 > with the explicit use of adapted objects because it tells me exactly 
 > what's going on.

I don't see that moving this into a helper API changes this; it's
simply part of that API's contract that it uses the right adaption for
the content object.

 > Btw, what about the other methods: remove, move?, others? With all of 
 > Zope 3's support for explicit interfaces, do we really want to lump all 
 > of this into zapi?

I think there should be three helpers in this group: add(), move(),
and remove().  add() and remove() can probably be trivial wrappers
around move().


  -Fred

-- 
Fred L. Drake, Jr.  <fred at zope.com>
PythonLabs at Zope Corporation



More information about the Zope3-dev mailing list