[Bioperl-l] multiple inheritance

Christopher Cavnor ccavnor at systemsbiology.org
Thu Jul 31 12:16:00 EDT 2003


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.

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






More information about the Bioperl-l mailing list