[Bioperl-l] Identifiable and Describable

Hilmar Lapp hlapp@gnf.org
Wed, 24 Jul 2002 10:37:56 -0700


> 
> 
> 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?
> 

Yeah, this seems to be right pattern. This is essentially the same as CoordinatePolicy in LocationI. And I think Dave is right in that we should refactor gff_string() to be implemented by the same pattern.

I'd actually vote for the 'full' implementation of the pattern, i.e., plan b) :)

	-hilmar