[Bioperl-l] Identifiable and Describable
Ewan Birney
birney@ebi.ac.uk
Wed, 24 Jul 2002 11:20:47 +0100 (BST)
On Tue, 23 Jul 2002, Hilmar Lapp wrote:
> >
> > I still don't think LSID/MOBY/Ensembl's are different
> > implemetnations -
> > they use the same slots in semantically identical ways and it is more
> > encoding things...
> >
>
> They do, right. But the LSID string would be an encoding, wouldn't it?
> And another one might encode the same information in a different way,
> right? So, the method lsid_string() returns an encoding, and the name
> implies that it's a specific encoding.
Yup.
>
> One could rename to say id_string() in the interface, and an
> implemention using the LSID encoding then returns an LSID-compliant
> string ... Does that make sense?
I don't think this would be sensible because ... say, in your case, ...
bioperl-db attaches a Bio::Identifiable::Yadda implementation with Yadda
encoding, but then you want to get out a LSID encoding - the client would
have to artificially build an LSID module.
Three real solutions here in my view:
(a) just keep adding new encodings to Bio::IdenitifiableI interface (lsid,
moby, whatever). Encodings should be cheap and easy functions to add, and
I see no problem in adding their *implementation* at the interface level
in this "decorated interface" idea that we use
(b) something like a visitor pattern which would be:
Bio::Identifier::EncodingVisitorI
::EncodingVisitor::LSID
::EncodingVisitor::Moby
and then it would be
$encoding = $bio_identifiable_obj->encoding($encoding_visitor);
(c) sort of like the above, but via a string, and with a proposed
implementation
$encoding = $bio_identifiable_obj->encoding('lsid');
Preferences?
>
> -hilmar
> --
> -------------------------------------------------------------
> GNF Genome Informatics: We like beer, not whine.
> -------------------------------------------------------------
>
-----------------------------------------------------------------
Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
<birney@ebi.ac.uk>.
-----------------------------------------------------------------