[Biojava-dev] Re: [Biojava-l] Mutable Features - strand?
Thomas Down
thomas at derkholm.net
Wed Jul 2 14:21:28 EDT 2003
Once upon a time, Matthew Pocock wrote:
> Keith James wrote:
> >ProjectedStrandedFeatures currently throw a ChangeVetoException
> >because I can't see how to propagate the change back through the proxy
> >(I don't think the ProjectionContext interface provides the necessary
> >information).
> I think we need to re-visit the ProjectionContext interface so that it
> supports bi-directional mappings of feature properties. Anybody with
> strong view? Thomas?
Hmmm, if we want mutability of projections (something that
doesn't convince me 100%, but I suppose it has its uses),
how about adding methods to ProjectionContext of the form:
public void setStrand(StrandedFeature f, Strand s)
throws ChangeVetoException;
That still keeps the projection system nicely flexible,
and the individual projection objects very simple (just
makes calls into ProjectionContext).
I guess the alternative is to gut ProjectionContext and rewrite
it with pairs of methods like:
public Strand projectStrand(Strand s);
public Strand reverseProjectStrand(Strand s);
This moves a bit more code into the projection objects, and
maybe simplifies writing ProjectionContexts a little bit.
If I was writing the whole thing from scratch today, I might
consider the second option. But I think the first option,
which doesn't require any significant changes to existing
code, is probably a better bet for BJ1.4.
Thomas.
More information about the biojava-dev
mailing list