adaptation (was: Zope 3.0, and why I won't use it)

Terry Reedy tjreedy at udel.edu
Tue Nov 16 18:06:06 EST 2004


>example?

The example used in the Zope3 programmer tutorial:

You have database of (USA) Buddy objects, each with firstname, lastname, 
streetaddress, zipcode, and email fields.  You want to use them in a 
context that requires the (redundant) city and state fields.  So you write 
a zip to city/state lookup function and then an ExpandedBuddy adapter that 
gets the zip from the adapted Buddy, calls city_state(zip), and packages 
the result together as needed in the usage context.

Terry J. Reedy






More information about the Python-list mailing list