[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java Tip 68: Learn how to implement the Command pattern in Java - JavaWorld - February 1999



Hi Rick,

> > True.  But, then, I've not found sub-classing to be a particularly
> > useful mechanism for extending (i.e. re-using) code.  At least, not
> > when the examples start to get non-trivial.
> 
> 
> The rest of the world seems to disagree.

Yes, they certainly do ... but OO shows many symptoms of being some
funny religious cult that imposes its will simply by making assertions
... like "inheritance makes reuse of code simple".  Presumably, lots
of studies of its use in non-trivial practice is reported somewhere
and has been scientifically evaluated as not being fluffy-twoddle?

But seriously, what about the Case Study I quoted ... about the change
in the GUI event API *away* from one based on inheritance (JDK1.0) and
*to* one based on delegation (i.e. callbacks)?  And the reason for that
change ... that the inheritance mechanism didn't pan out when used in
anger?

The OO community always lays big stress on inheritance (and its associated
dynamic binding of method names to actual code).  occam, along with Ada
and other languages, is deprecated by this community as merely being
`object-based', not `object-oriented'.  Objects without inheritance
(i.e. `object-based' things) are just Abstract Data Types with a new
syntax.  Objects working with delegation are still just ADTs.  It's
inheritance that makes `Objects' different.

If inheritance doesn't work in practice - and, presumably, the designers
of the JDK1.0 event API designed with extenisibility in mind ... indeed,
that is the whole force behind that (now deprecated) API - then we should
forget about OO ;-)

Time for the weekend!

Peter.