[Bioperl-l] RootI

Jason Stajich jason@cgt.mc.duke.edu
Mon, 18 Mar 2002 08:46:35 -0500 (EST)


I cannot be in charge of this - but - someone needs to work on the
inheritance refactoring in Bio::DB - it needs a firm looking at - I tried
to do this before 1.0 but only so much one guy can do...

RandomAccessI and SeqI separation is probably not clear - SeqI is really
only for the Index modules which can realistically return a SeqStream for
all its sequences, none of the remote databases should be expected to do
this.  However batch retrieval method (get_Stream_by_batch, etc) should be
put into an interface.


WRT to RootI inheritance - Here's a fun one - Try changing
Bio::DB::RandomAccessI to be a RootI rather than Root child class.
Run the DB  or EMBL_DB tests....

Don't forget - Elia - I had to fix in the Registry or Failover modules
the following has been the way to init objects
sub new {
 my ($class,@args) = @_;
 my $self = $class->SUPER::new(@args);
 ...
 return $self;
}

You then get the methods verbose, throw, warn, debug all for free and
don't need to detect a verbose flag in the @args (handled by the chained
new) and you don't need to rebless the object.

I realize this has some performance problems - we circumvent the chained
new in the SeqIO::FTHelper where potentially creating many many feature
objects or locations can get bottlenecked in new().  Something we can look
into in the future to try and profile and pick the best method.  The
current way gives us good chained contructors which behave like one would
expect OO constructors to.

-j

On Mon, 18 Mar 2002, Heikki Lehvaslaiho wrote:

> Elia Stupka wrote:
> >
> > Any reason why we still have so many RootI inheriting objects in
> > bioperl? Shouldn't we move them to Root?
>
>
> Only interface files should inherit from RootI,
> all others should inherit from Root.
>
> This would be important to fix as instantiating RootI
> inheriting class prints a warning.
>
>
> > Let me know if I should commit all modules changed to inheriting to
> > Root...
>
> Please do. - taking into account I files.
>
> 	-Heikki
> >
> > Elia
> > --
> > ********************************
> > * http://www.fugu-sg.org/~elia *
> > * tel:    +65 874 1467         *
> > * mobile: +65 90307613         *
> > * fax:    +65 777 0402         *
> > ********************************
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l@bioperl.org
> > http://bioperl.org/mailman/listinfo/bioperl-l
>
>

-- 
Jason Stajich
Duke University
jason@cgt.mc.duke.edu