[Biopython-dev] interface/SQL development policies

Yves Bastide Yves.Bastide at irisa.fr
Wed Aug 18 12:36:24 EDT 2004


James Casbon wrote:
>>>* the two classes imply a common interface X, what is the best way of
>>>handling this in python?  An abstract base class?
>>
>>Separate classes, the interface being checked via unit tests
> 
> 
> As the classes have developed, it has become apparent there is identical code 
> in both classes which is independent of the implementation of the backend.
> 
> In the light of this, an abstract class with some defined methods becomes more 
> appealing, or should the common functionality be moved out of the class?

Nonono. Think XP: develop two separate classes with slightly differing 
internals, then refactor. :-)

Seriously, using a common base class looks like the best solution. 
(Course, don't call it abstract, since its main appeal will be to 
implement the commonalities.)

However there are two distinct roles mixed-up here: common functions, 
interface, and default behavior.

Pythoners are less interested in explicit interface (i.e. writing a 
bunch of methods raising NotImplemented)

> 
> james
> 

yves



More information about the Biopython-dev mailing list