[Bioperl-l] 0.7 release: Bio::Root::* classes
Hilmar Lapp
lapp@gnf.org
Tue, 14 Nov 2000 12:43:58 -0800
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
BTW isn't it Bio::SeqFeature::SimilarityPair what you're actually meaning?
>
> 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.
>
I do think the _initialize() mechanism has proven very useful and clean.
Constructor chaining up the tree of inheritance is not only something very
common in OO, it's essential. Unfortunately the inherent PerlOO flaws come
in here.
Still, a subclass shall not need to worry about how to create the object,
and it also shall not need to worry about how to setup the base class apart
from adhering to a requirement to call a certain (inherited) method and
passing all the initialization arguments to it.
I have no problem with dropping _initialize() a long as its functionality
is kept in another way. But then, I never found the _initialize() approach
cumbersome or dirty, so why not keep it and migrate that part to RootI?
Hilmar
--
-------------------------------------------------------------
Hilmar Lapp email: lapp@gnf.org
GNF, San Diego, Ca. 92121 phone: +1-858-812-1757
-------------------------------------------------------------