[Bioperl-l] Use of Root.pm versus RootI.pm

Hilmar Lapp hlapp at gmx.net
Tue Oct 3 12:27:46 UTC 2006


The interface classes (those ending in 'I') should actually inherit  
from RootI, not Root.

In reality this recommendation is more theoretical than it makes that  
much of a difference I think. The motivation is that interface  
classes should not determine the actual implementation of a class  
(hash ref, array ref, whatever), and since Root.pm contains lots of  
implementation using a hash ref that decision will basically have  
been made.

On the contrary though, RootI contains implementation too, although  
I'm not sure it would prescribe the object implementation as opposed  
to merely implementing static methods (like throw(), warn(), etc).  
That would need to be checked.

	-hilmar

On Oct 3, 2006, at 12:30 AM, Torsten Seemann wrote:

> My understanding is that all Bioperl-compliant classes should inherit
> from Bio::Root::Root, not Bio::Root::RootI.
>
> Additionally, if functions such as throw() or _rearrange() are to be
> used without a class instance reference, they are to be used as class
> methods via Bio::Root::Root, not Bio::Root::RootI.
>
> Is this correct?
>
> My naive audit of bioperl-live CVS brought up the following  
> statistics:
>
> # Root.pm
> /cvs/bioperl-live $ grep -r 'use Bio::Root::Root;' Bio | wc -l
> 26
> /cvs/bioperl-live $ grep -r 'use base.*Bio::Root::Root' Bio | wc -l
> 346
>
> # RootI.pm
> /cvs/bioperl-live $ grep -r 'use Bio::Root::RootI;' Bio | wc -l
> 9
> /cvs/bioperl-live $ grep -r 'use base.*Bio::Root::RootI' Bio | wc -l
> 79
>
> My guess would be that all RootI should be changed to plain Root ?
>
> Any help appreciated,
>
> -- 
> Dr Torsten Seemann               http://www.vicbioinformatics.com
> Victorian Bioinformatics Consortium, Monash University, Australia
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>

-- 
===========================================================
: Hilmar Lapp  -:-  Durham, NC  -:-  hlapp at gmx dot net :
===========================================================








More information about the Bioperl-l mailing list