Skip to content
Prev 1758 / 21312 Next

[Bioc-devel] implementing interfaces

Leaping in - where it might be best not to,
the point that James is making is that, if we have a class, foo, on which we
have defined a number of operations (eg exprs(x), pData(x) etc) that retrieve
somewhat well defined entities, then an alternative to a class-centric method of
dispatch is to rely on the accessors (what James is calling an interface).

In that case, there is not a lot to be gained by defining an interface class,
one could just have a regular function (and indeed code reuse could be obtained
by having the methods just be interfaces to that function).

I disagree a little with the characterization that it is a more developer
friendly paradigm -- that depends on which developer we are talking about. The
one doing the original implementation, or the one that wants to add to it.  I
think that the approach James suggests makes more work initially, and less later
on.  But in any event, it is a good thing for folks to think about.

The good thing, is that if things are as James suggests, I don't think he needs
to write a very big patch to get the behavior he wants :-). And I at least don't
see the discussion as complaining,

 best wishes
   Robert
Sean Davis wrote: