Bioperl: Bio::Root::RootI::_rearrange

hilmar.lapp@pharma.Novartis.com hilmar.lapp@pharma.Novartis.com
Tue, 6 Jun 2000 18:34:45 +0100


I may be completely wrong with the following due to my limited experience with
bioperl, and if so, please ignore.

Given the case that a subclass introduces some additional parameters. In the
initialization method of that subclass you would now call _rearrange() with all
arguments passed and the parameter names you're interested in,  i.e., those of
the additional ones. You wouldn't specify the parameters of the inherited class'
initialization, because that class is supposed to be able to handle these itself
at best. So, both initialization methods would call _rearrange(), and both would
get an exception (the parent because it doesn't know that the additional
parameters are allowed).

I think this is already used this way in BioPerl itself, and I've written
something that works this way. So, I'm not sure: would this be incorrect code
then, or would you rather indeed break code with the modification you are
suggesting?

Cheers,

     Hilmar







James Gilbert <jgrg@sanger.ac.uk> on 06.06.2000 14:40:05

To:   Bioperl <vsns-bcd-perl@lists.uni-bielefeld.de>
cc:    (bcc: HILMAR LAPP/PH/Novartis)

Subject:  Bioperl: Bio::Root::RootI::_rearrange






The Bio::Root::RootI::_rearrange method, which is
used to parse arguments like:

     $obj = Class->new(
         -id => 'foo',
         -seq => 'acatgctagagctagcatcgacgatg',
         );

doesn't do anything if you pass invalid options
(if, for example, "seq" isn't a valid option for
the "new" method above).  I think it should throw
an exception.  Does anyone object if I add this?
I can't see that it will break anything, unless
someone relies on this behaviour.

     James

James G.R. Gilbert
The Sanger Centre
Wellcome Trust Genome Campus
Hinxton
Cambridge                        Tel: 01223 494906
CB10 1SA                         Fax: 01223 494919

=========== Bioperl Project Mailing List Message Footer =======
Project URL: http://bio.perl.org/
For info about how to (un)subscribe, where messages are archived, etc:
http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
====================================================================




=========== Bioperl Project Mailing List Message Footer =======
Project URL: http://bio.perl.org/
For info about how to (un)subscribe, where messages are archived, etc:
http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
====================================================================