On Fri, Aug 22, 2008 at 10:34 AM, Sean Owen <[EMAIL PROTECTED]> wrote:

> You are right, I am not sure it makes any significant difference in
> speed. The only situation where I know it can help is in ProGuard
> optimization as it can perform inlining as a result. The better
> argument is just for correctness -- if you aren't sure you set up the
> class for subclassing, prohibit it.


I would come to *exactly* the opposite conclusion.  Until you have *PROVED*
that the performance is need from exactly that piece of code, don't prohibit
subclassing.


> But if there are helpful reasons to make classes extendable, leave it so,
> yes.


The strongest reason is that other people are clever and are likely to come
up with something good.

Interfaces (or abstracts as Karl would prefer) are fine and dandy, but lots
of stuff isn't worth building the whole framework of classes around, but is
still worth testing with mocks.

Reply via email to