[Bioperl-l] Auto-method caller proposal

Sendu Bala bix at sendu.me.uk
Tue Jan 9 06:38:11 EST 2007


Nathan (Nat) Goodman wrote:
> On Jan 3, 2007, at 1:09 PM, Sendu Bala wrote:
> 
>> I propose a method that sets method values based on user-supplied args 
>> to new()...
> 
> You might take a look at Class::AutoClass and its companion
> Class::AutoClass::Args (both available in CPAN) which do most of what you
> want.

It does look really good and is certainly featurefull. Before 
investigating it I already had to add a synonym handling scheme to my 
proposed code.


> We use it extensively.  It handles auto-generation of set and get
> methods but can also be used to pass arguments into programmer-coded
> methods.  It's already used in BioPerl in Bio::Graph::SimpleGraph, a module
> that we provided for a specialized purpose (may be obsolete). 

My concern is that Bio::Graph::SimpleGraph doesn't inherit from 
Bio::Root::Root. How difficult would that have been? I'm also concerned 
that it would be too difficult to change things over to using 
Class::AutoClass if _init_self() methods have to be added all over the 
place.

Alternatively, would the system work if only Bio::Root::RootI was based 
on Class::AutoClass? What would the necessary code be for changes in 
RootI and then changes in an existing run-wrapper for example?


> Historical background: we offered AutoClass to BioPerl years ago, but it was
> shot down by senior members of the development community.  If I recall
> correctly, there was concern about debuggability and understandability of
> code that relied on auto-generated methods and too much magic argument
> processing.  These are reasonable concerns. Perhaps these issues should be
> aired again to make sure the key people agree with this direction before too
> much effort is spent

Personally I'm in favour of not having auto-generated methods except as 
a last resort, but that last resort does need to be there or it becomes 
simply too depressing to write run-wrappers. I'm not sure I like the 
idea of purely 'magic' argument processing, preferring an explicit 
method call which makes it clear what you have chosen to do. But perhaps 
that could be implemented in a RootI method using Class::AutoClass? If 
so, can you offer some example code of how that might be done?



More information about the Bioperl-l mailing list