Skip to content
Prev 5573 / 21312 Next

[Bioc-devel] metadata() in BiocGenerics?

Hi Vince,
On 04/10/2014 08:16 AM, Vincent Carey wrote:
I could do that but...

Good object design would be that if a developer wants its class to
support the metadata() getter and setter, s/he should extend the
Annotated class defined in IRanges. This class has only 1 slot, the
metadata slot, and a very simple API: just metadata(). So by extending
it, metadata() will work out-of-the-box on his/her objects. This avoids
code duplication and ensures that the metadata() getter and setter
behave consistently on all objects.

I can see that a developer could be reluctant to depend on IRanges just
to inherit the Annotated class though. But maybe this means that the
Annotated class and the metadata() generic are in the wrong package?

Cheers,
H.