[Bioperl-l] 0.7 release: Bio::Root::* classes

Ewan Birney birney@ebi.ac.uk
Tue, 14 Nov 2000 20:43:07 +0000 (GMT)


On Tue, 14 Nov 2000, Jason Stajich wrote:

> A consequence of going to RootI. 
> Take a look at the following classes.
> 
> Bio::SeqFeature::Similarity -> ISA Bio::SeqFeature::FeaturePair -> ISA Bio::SeqFeature::Generic
> 
> We use the clever SUPER::_initialize(@args) to pass initialization
> arguments up the hierarchy so that each can essentially obtain what they
> need from args and a sub class can have additional arguments not supported
> by the superclass.  To move to RootI each class will have its own new
> function and will not call new on its superclass.   We could still 
> create an initialize function that each class has and can call or else
> a change at the top will require changing the subclasses.  
> 
> Comments on a better way to handle this?

perl does not handle this great, but you can write a new function in the
subclass which calls the new in the base class with arguments and then 
reblesses into the subclass.

not pretty, but nor is _initialize


-----------------------------------------------------------------
Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
<birney@ebi.ac.uk>. 
-----------------------------------------------------------------