[Bioperl-l] Auto-method caller proposal
Chris Fields
cjfields at uiuc.edu
Tue Jan 9 17:29:06 UTC 2007
On Jan 9, 2007, at 9:12 AM, Sendu Bala wrote:
> Nathan (Nat) Goodman wrote:
>>>> On Jan 3, 2007, at 1:09 PM, Sendu Bala wrote:
>>
>>> 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?
>>
>> Yes, it should work for Bio::Root::RootI to inherit from AutoClass.
>> This, however, would impose AutoClass on every BioPerl-er whether
>> they
>> want it or not :)
>
> As a generally useful thing I'd like to see all Bioperl modules have
> easy access to this functionality, just as they can currently call
> _rearrange(). So yes, we would impose AutoClass on everyone. This may
> not be a major burden since it is already an optional pre-
> requisite. So,
> before I investigate using Class::AutoClass instead of my own proposed
> method, does anyone feel there are good benefits of Class::AutoClass
> over my proposed method (considering I already added a -synonym option
> to it), and do those benefits outweigh having Class::AutoClass as a
> Bioperl installation requirement?
To me, this goes back to Aaron's argument about 'reinventing the
wheel.' If you can accomplish what you need using Class::AutoClass,
why not use it? Or as Nat suggests, use the relevant
Class::AutoClass code directly in RootI. However, if you believe
your method is simpler, by all means use that.
The main criticisms about using autogenerated methods (summarized by
Nat) seem to be that (1) they cause problems with understanding code
and debugging, and (2) too magic argument processing. However, there
are many instances where AUTOLOAD is being used in bioperl to deal
with general get/setters, or a similar kludge (like the heredoc eval
{} kludge I posted earlier) is used instead. Based on that and your
previous post there is obviously a need for some way to autogenerate
methods like get/setters, even if that need isn't expressed openly.
chris
More information about the Bioperl-l
mailing list