Indicates that an object has an associated annotation.

Namespace:  BioSharp.Core.Bio
Assembly:  BioSharp.Core (in BioSharp.Core.dll) Version: 0.1.3191.26120 (0.1.0.0)

Syntax

C#
public interface IAnnotatable : IChangeable

Remarks

Many BioSharp objects will have associated unstructured data. This should be stored in an IAnnotation instance. However, the BioSharp object itself will probably not want to extend the IAnnotation interface directly, but rather delegate off that functionality to an Annotation property. The IAnnotatable interface indicates that there is an Annotation property. When implementing IAnnotatable, you should always create a protected or private field containing an instance of ChangeForwarder, and register it as a ChangeListener with the associated Annotation delegate instance.

Check if BioSharp classes and interfaces derive from IAnnotatable. This will tell you if you should look for associated annotation.

If an object implements IAnnotatable, it may well propagate ChangeEvent notifications from the associated Annotation. You may need to track these to maintain the state of your applications.

Be careful to hook up the appropriate event forwarders.

The Annotation property can be implemented lazily (instantiate the Annotation instance and event forwarders when the first request comes in). It can also be implemented by returning throw-away immutable Annotation instances that are built from scratch each time.

Note that in BioJava, this interface contained a nested objects, which is not allowed in .Net. These have been broken out to the Annotatable class.

Original BioJava version by Matthew Pocock, Keith James, and Kalle Naslund (docs). Port to C# by Doug Swisher.

See Also