[PEAK] PEAK Components: beginner questions

Phillip J. Eby pje at telecommunity.com
Wed Sep 22 11:48:11 EDT 2004


At 11:11 AM 9/22/04 -0400, Duncan McGreggor wrote:
>So not only do we not really see how they should be designed, we don't 
>even look at them from the right end: we tend to "write" our classes 
>first, and then the interfaces. Your comments about behavior put a fresh 
>perspective on things... it makes interfaces a vital part of code as 
>opposed to a only being a docstring container.

To some extent, that's a PyProtocols/PEP 246 influence.  Without object 
adaptation, interfaces aren't quite as useful.  But with adaptation, the 
best way to design a collaboration of objects is to focus on the essential 
and desired behaviors.  Then, you determine how to adapt the behavior of 
existing objects to perform your desired behavior.  Think of it as 
programming by doing a "diff" between the spec and the existing available 
software.  :)




More information about the PEAK mailing list