[Bioperl-l] multiple inheritance

Matthew Pocock matthew_pocock at yahoo.co.uk
Thu Jul 31 12:59:00 EDT 2003


Christopher Cavnor wrote:

> I strongly agree with the latter.
> 
> An additional benefit to having the interface <-> simple implementor relationship is the ability to unit test the impl object and assure that this impl does what the interface and interface docs promise.

Yet another benefit is that you can swap the impls of either delegate 
without changing the impl of the object that is the combined interface - 
this gives you loads of choice for mix & match implementation 
combinations with no extra implementation code.

> 
> Chris Cavnor
> Institute for Systems Biology
> http://systemsbiology.org/
> 
> 
> -----Original Message-----
> From:	Ewan Birney [mailto:birney at ebi.ac.uk]
> Sent:	Thu 7/31/2003 12:48 AM
> To:	Jason Stajich
> Cc:	Bioperl
> Subject:	Re: [Bioperl-l] multiple inheritance
> 
> 
>>Comments?
> 
> 
> Why not go to a composition/delegation mode, with one object having the
> other one, rather than multiple inherietance.
> 
> 
>   Or, if you want to keep symmetry,
> 
> have two interface definitions.
> 
> Have two separate implementation objects which separately inheriet from
> each interface
> 
> Have a single holder object which multiply inheriets from each interface
> and has-a copy of each object. Put code which knows about "both" objects
> into the holder object and delegate interface calls to the right object.
> 
> This will actually keep your code cleaner, as it forces the dual methods
> to be cleanly separated from the single methods
> 
> 
> 
> multiple inherietance of implementations is downright evil IMNSHO - avoid
> at all costs...
> 
> 
> 
> 
>>--
>>Jason Stajich
>>Duke University
>>jason at cgt.mc.duke.edu
>>_______________________________________________
>>Bioperl-l mailing list
>>Bioperl-l at portal.open-bio.org
>>http://portal.open-bio.org/mailman/listinfo/bioperl-l
>>
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
> 
> 
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
> 


-- 
BioJava Consulting LTD - Support and training for BioJava
http://www.biojava.co.uk



More information about the Bioperl-l mailing list