[Bioperl-l] Identifiable and Describable

Hilmar Lapp hlapp@gnf.org
Tue, 23 Jul 2002 14:59:41 -0700


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
>