[Bioperl-l] Identifiable and Describable
Lincoln Stein
lstein@cshl.org
Mon, 29 Jul 2002 23:27:37 -0700
$encoding = $bio_identifiable_obj->encoding('lsid');
I find this ugly and inconvenient.
Lincoln
Hilmar Lapp writes:
> >
> >
> > 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
> _______________________________________________
> 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
========================================================================