[Bioperl-l] Bio::Ontology::Term (rollback question)
Hilmar Lapp
hlapp at gmx.net
Mon Aug 27 23:07:12 UTC 2007
The B::O::TermI interface actually says that get_dblinks() would
return scalars. That's why the add_dblink methods accept strings. I
also agree that this is inconsistent with with the rest of BioPerl.
Oddly enough, Term::add_dblink_context() does ask for DBLink objects,
though it doesn't seem to be enforced, even though
Term::get_dblink_context() is advertised as returning scalars.
So it does seem this is messed up design-wise. It seems to me that to
really fix this would inevitably break the API, and I don't see how
you would make this backwards compatible w/o creating a lot of messy
code, the sole purpose of which would be backwards compatibility.
One could only fix Term::add_dblink_context() as it's not in the
interface but that wouldn't contribute anything to improving
consistency.
So the alternative to breaking the API in a non-backwards compatible
fashion would be to add to it, map the existing dblink methods onto
the added ones, and start deprecating them. For example, you could
add methods get_dbxrefs() (also on the interface), add_dbxref(),
etc, and build in a context argument so we don't need another set
of methods for that. They would accept and return DBLink objects, and
the get_dblink() methods could be changed to map those to scalars
while also getting slated for deprecation.
Does this make sense?
-hilmar
On Aug 27, 2007, at 6:31 PM, Chris Fields wrote:
> This is related to the ongoing Feature/Annotation rollback. I have
> found that a few Ontology-related modules are (either directly or
> indirectly) passing strings instead of Bio::Annotation::DBLinks to
> Bio::Ontology::Term::new(), add_dblink(), or add_dblink_context()
> (thelast is where the error occurs).
>
> If needed we could allow strings to be passed but this isn't
> consistent with the API. Any thoughts on what to do here?
>
> chris
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
--
===========================================================
: Hilmar Lapp -:- Durham, NC -:- hlapp at gmx dot net :
===========================================================
More information about the Bioperl-l
mailing list