[Zope3-dev] Stylistic question about using adapters

Garrett Smith garrett at mojave-corp.com
Fri Jan 21 11:43:12 EST 2005


Florent Guillaume wrote:

> From the
> code of a MailMessage, I need to get some config parameters from the
> mailbox.

This sounds like your adaptation:

  class IConfigInfo(Interface):
     param1, param2, ...

  configInfo = IConfigInfo(mailMessage)
  ...

The fact that the info is stored in the mail container is really of no
concern to the user of that info. This is the indirection that Jim
mentioned. While you may never need it, this approach gives you
flexbility as to how you provide IConfigInfo for mail messages.

 -- Garrett


More information about the Zope3-dev mailing list