[Bioc-devel] metadata() in BiocGenerics?

Hervé Pagès hpages at fhcrc.org
Thu Apr 17 08:37:24 CEST 2014


Hi Vince,

On 04/10/2014 08:16 AM, Vincent Carey wrote:
> seems like something we should use more routinely, and it was not
> straightforward for me to find it in IRanges

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.

>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>

-- 
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



More information about the Bioc-devel mailing list