[Zope3-Users] Stylistic question about using adapters

Florent Guillaume fg at nuxeo.com
Wed Jan 19 11:22:18 EST 2005

I'm wondering if using adapters is the best way to do the following:

I have a MailBox class that holds central information, and it contains 
instances of MailFolder that themselve contain MailMessage. From the 
code of a MailMessage, I need to get some config parameters from the 
mailbox. So somewhere I have a function that goes up the containment 
hierarchy to find an IMailBox (I'd rather not make it a method of 
MailMessage because it's really got to do with the containment hierarchy 
and not the behavior of the message itself).

Is it best to leave this function standalone and call it directly, or is 
it better somehow to make it into an adapter from IMailMessage to 
IMailBox ? I'm not really "adapting" here, I'm returning a completely 
different object, so I have philosophical problems...

What do you think is best ?


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-users mailing list