[Biojava-dev] SimpleFeature simple question

Paul.Seed@geneprot.com Paul.Seed@geneprot.com
Fri, 8 Nov 2002 11:48:24 +0100


Hello -

I have a small question about the behaviour of SimpleFeature - I'm sure
there's a good reason for it, but it's not immediately obvious to me why
the constructor creates a new SimpleAnnotation based on the Template
annotation:

        this.loc = template.location;
        this.type = template.type;
        this.source = template.source;
        this.annotation = new SimpleAnnotation(template.annotation);

... rather than simply using the annotation from the template directly:

        this.annotation = template.annotation;

This behaviour caught me out when I created a feature (using the default
feature realizer) based on a template containing my own Annotation
implementation.  When I later accessed the feature's annotation, I was
surprised to find that it was a SimpleAnnotation rather than my own
implementation class.  I can avoid the problem by using a custom
"MySimpleFeature" that takes its Annotation directly from the Template, but
I'd like to increase my knowledge of BioJava by understanding what this
workaround might break!

Thanks, best regards


- Paul Seed.

Bioinformatician
GeneProt Inc. (Geneva Branch)
Tel. +41 (0)22 719 88 36
Fax. +41 (0)22 719 88 69