Skip to content

alternatives for AUTOLOAD #15

@fschwach

Description

@fschwach

Just wanted to raise this as a new issue because the pull request in which we discussed this originally is already closed but this issue is still open for discussion.

The problem: there is a large number of tags for input and output to/from primer3 for which we may want to create accessors. Writing all those accessors explicitly as methods will bloat the code quite a bit and may be a maintenance problem. AUTOLOAD is not an ideal solution and Bio::Root::Root::_set_from_args is only meant to create accessors from arguments given at object instantiation, which is not what we need.

I think these are the options:

  1. We could auto-generate accessors for the various output tags of primers and primer pairs by setting up methods from a list of allowed tag names (similar to what I have already done in Tools::Run::Primer3Redux::_create_run_methods) but I'm not sure if that is acceptable style for BioPerl?
  2. I can create all the subs for the different tag accessors and paste them into the code.
  3. Instead of creating direct accessor methods for each tag by name (such as $primer->hairpin_th), we could have methods "has_tag" and 'tag_value' where the tag name would have to be given as an argument. Maybe that's the cleanest solution.

What do you think?

Frank

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions