[Bioperl-l] Identifiable and Describable

David Block dblock@gnf.org
Wed, 24 Jul 2002 08:27:19 -0700


On Wednesday, July 24, 2002, at 03:20 AM, Ewan Birney wrote:

> On Tue, 23 Jul 2002, Hilmar Lapp wrote:
>> 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?
>
>
These implementations sound a lot like our gff_string methods - it's 
just a way of providing a string based on the attributes of the object.

The interesting part will be the IO modules that take LSID's and give 
you the object without further ado.

Lincoln had code that guessed at the proper database, right?  This just 
makes that explicit.

-Dave (just waking up)


>
>>
>> 	-hilmar
>> --
>> -------------------------------------------------------------
>> GNF Genome Informatics: We like beer, not whine.
>> -------------------------------------------------------------
>>
>
> -----------------------------------------------------------------
> Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
> <birney@ebi.ac.uk>.
> -----------------------------------------------------------------
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>
--
David Block                                  dblock@gnf.org
GNF - San Diego, CA             http://www.gnf.org
Genome Informatics / Enterprise Programming
Weblog:      http://radio.weblogs.com/0104507/