[Zope3-dev] Stylistic question about using adapters
Florent Guillaume
fg at nuxeo.com
Mon Jan 24 12:23:02 EST 2005
Garrett Smith <garrett at mojave-corp.com> 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.
Thanks, that looks like a much better way to cover these abstractions.
Florent
--
Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D
+33 1 40 33 71 59 http://nuxeo.com fg at nuxeo.com
More information about the Zope3-dev
mailing list