[Bioperl-l] Backward compatibility mode for Bio::Root::RootI

Lincoln Stein lstein@cshl.org
Sun, 9 Dec 2001 15:55:51 -0500


I would suggest putting this in Bio::Root::RootI

 sub new {
     local($^W) = 0;
     my ($caller, @args) = @_;

     my $self = $caller->_create_object(@args);

     my %param = @args;
     my $verbose =  $param{'-VERBOSE'} || $param{'-verbose'};

     ## See "Comments" above regarding use of _rearrange().
     $self->verbose($verbose);

     return $self;
 }

 sub _create_object {
    my $class = shift;
    warn "Attempt to use deprecated API: Please use Bio::Root::Root instead";
    require Bio::Root::Root;
    return Bio::Root::Root->new(@_);
 }

This way, if they try to create a new Bio::Root::RootI object, they get a 
Bio::Root::Root (and a deprecation warning) instead.

Lincoln

On Sunday 09 December 2001 14:54, Ewan Birney wrote:
> I basically like the split of Bio::Root::RootI interface away
> from implementation, but it does give us a backward compatibility
> problem.
>
>
> Some (external) modules written using Bioperl - in particular large tracks
> of Ensembl (say - 50 modules) - now break as they assumme that
> Bio::Root::RootI new works.
>
>
> There is alot of active ensembl's out there with the current code base,
> and we are not going to be able to change these code bases (they are off
> the stable branch of ensembl) by Janurary.
>
>
> What I would like to do is reintroduce a new function to RootI (blesses an
> anonymous hash) with a strong "deprecated" warning being thrown.
>
>
>
> Jason/Lincoln/anyone else - do you think this ok?
>
>
>
>
> ewan
>
>
>
>
>
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l

-- 
========================================================================
Lincoln D. Stein                           Cold Spring Harbor Laboratory
lstein@cshl.org			                  Cold Spring Harbor, NY

NOW HIRING BIOINFORMATICS POSTDOCTORAL FELLOWS AND PROGRAMMERS. 
PLEASE WRITE FOR DETAILS.
========================================================================