[Bioperl-l] multiple inheritance
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.
Institute for Systems Biology
From: Ewan Birney [mailto:birney at ebi.ac.uk]
Sent: Thu 7/31/2003 12:48 AM
To: Jason Stajich
Subject: Re: [Bioperl-l] multiple inheritance
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
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
Bioperl-l mailing list
Bioperl-l at portal.open-bio.org
More information about the Bioperl-l