Generational Interfaces

Paul Rubin http
Sat Jan 26 00:32:10 EST 2008


Carl Banks <pavlovevidence at gmail.com> writes:
> AirplaneInterface = InterfaceTracker("Airplane")
> ...
>         set_up_initial_state()
>         ...
>         AirplaneInterface.report(self)

> Thoughts?  (Surely someone's thought to do this before.)

A decorator might express the idea a little more naturally.  

Also, I'd say the interface tracker really should be told explicitly
when something is part of the interface and when it's specific to a
particular class implementing the interface.  It shouldn't try to
guess this based on some operation appearing in more than one class.
Maybe there's some operation done on all jet planes and on no
propeller planes, that shouldn't be part of the top level airplane
interface.



More information about the Python-list mailing list