[Bioperl-l] Identifiable and Describable

Lincoln Stein lstein@cshl.org
Mon, 29 Jul 2002 23:07:33 -0700


I like having lsid_string() in IdentifiableI.  Anything you delegate
to subclasses cannot be used by general-purpose software and basically
defeats the purpose of the interface.  The idea of LSID is to be a
generic identifier, so why not put it in the generic interface.

Besides, it's no worse than SeqI's gff_string()!

Lincoln

Hilmar Lapp writes:
 > I've seen lsid_string() there too, which I think shouldn't be there. It pertains to a specific implementation of IdentifiableI, namely the LSID implementation. Another one might have mobyid_string(), or whatever.
 > 
 > This leads to my other suggestion: I'd plead to have Identifiable in most if not all cases implemented by composition and not direct inheritance. This keeps the implementation flexible and open. With the design that Bio::PrimarySeq is-a IdentifiableI you've got to inherit from the interface, but internally the methods should all delegate to an object that implements IdentifiableI.
 > 
 > I.e., you would have
 > 
 > 	Bio::Identifier::SimpleID is-a IdentifiableI
 > 	Bio::Identifier::LSID is-a IdentifiableI
 > 	Bio::Identifier::MobyID is-a IdentifiableI
 > 	Bio::Identifier::EnsemblID is-a IdentifiableI
 > 	# ... and whatever more you wish
 > 
 > 	Bio::PrimarySeqI is-a IdentifiableI
 > 
 > 	Bio::PrimarySeq
 > 
 > 		sub identifier { ... } # get/set IdentifiableI impl.
 > 
 > 		sub object_id {
 > 			my ($self, @args) = @_;
 > 			return $self->identifiable()->object_id(@args);
 > 		}
 > 
 > 		...
 > 
 > Those who want an LSID implementation can have it. Those who want another can have it too.
 > 
 > A somewhat unrelated question is how authority and namespace map to biosql. There is only biodatabase now with a name field ... Do we simply add an authority attribute? (i.e. one combination of authority/namespace makes one biodatabase entry?)
 > 
 > 	-hilmar
 > 
 > 
 > > -----Original Message-----
 > > From: Ewan Birney [mailto:birney@ebi.ac.uk]
 > > Sent: Monday, July 22, 2002 4:12 PM
 > > To: bioperl-l@bioperl.org
 > > Subject: [Bioperl-l] Identifiable and Describable
 > > 
 > > 
 > > 
 > > I have put in two interfaces, IdentifiableI and DescribableI into
 > > bioperl.
 > > 
 > > 
 > > IdentifiableI defines
 > > 
 > >    ->object_id
 > >    ->version
 > >    ->namespace
 > >    ->authority
 > > 
 > > I debated adding the common ideas of display_id and description which
 > > also are often properties associated with Sequences/Go terms/Pfam
 > > domains/Interpros whatever, but realised that ideally this is another
 > > interface, which I described as DescribableI
 > > 
 > >   Methods
 > > 
 > >    display_name
 > >    description
 > > 
 > > 
 > > I made PrimarySeqI isa both an IdentifiableI and DescribableI 
 > > and adjusted
 > > PrimarySeq implementaiton - need to also handle Seq and then the SeqIO
 > > system.
 > > 
 > > 
 > > This is not written in stone yet, so people can still talk me 
 > > out of this
 > > route, but it feels comfortable for me so far....
 > > 
 > > 
 > > 
 > > 
 > > _______________________________________________
 > > Bioperl-l mailing list
 > > Bioperl-l@bioperl.org
 > > http://bioperl.org/mailman/listinfo/bioperl-l
 > > 
 > _______________________________________________
 > Bioperl-l mailing list
 > Bioperl-l@bioperl.org
 > http://bioperl.org/mailman/listinfo/bioperl-l

-- 
========================================================================
Lincoln D. Stein                           Cold Spring Harbor Laboratory
lstein@cshl.org			                  Cold Spring Harbor, NY
Positions available at my lab: see http://stein.cshl.org/#hire
========================================================================