Re: Java "interface" vs. OO interface

From: Justin Farley (null_at_void.com)
Date: 11/23/03


Date: Sat, 22 Nov 2003 23:45:31 GMT

Dave Harris wrote:
> null@void.com (Justin Farley) wrote (abridged):
>>> I don't think impure interfaces should be banned by the language.
>>
>> "impure interfaces" seems to me a contradiction in terms. Isn't the
>> whole point behind the constraint of Interfaces, is that they are,
>> at the very least, purely abstract?
>
> I think Java uses interfaces instead of classes because the designers
> couldn't figure out a good implementation of MI of classes. The
> ideology was a post-hoc justification.

The simplest thing that works, works well.

To think that the designers of Java and .NET couldn't figure out a good
implementation of MI, when there were plenty of well known good
implementations already, I think is a bit presumptuous. From what little
I've read from James Gosling (Java) and Anders Hejlsberg (C#), I'm convinced
that they *chose* the simplicity of constrained single
implementation-inheritance.

The same with DCOM/CORBA, and the subsequent simpler Service-Oriented
Architecture of Web Services. It is an intentional desire for constraints,
rather than the lack of a good implementation of something more complex,
that has driven the design IMO.

And again with the dumbing down of GUIs into the Web Browser single-click
stuff. The simplest thing that works is intentional design, not any lack of
a "good implementation".

>> There are many design patterns where pure abstract and instanceless
>> classes are useful. Enough for a language to adopt a new keyword
>> to identify them as such.
>
> I don't think so. Keywords need more justification than that, in my
> view.

Surely not the keyword alone?!? Humans are highly linguistic. I was being
somewhat sarcastic in suggesting that a new keyword was significant. What
is important is the explicit identification (and significance) of purely
abstract interfaces in designs. If all it takes is a keyword, it is well
worth it.

--
Justin


Relevant Pages

  • Re: Java "interface" vs. OO interface
    ... >> IMHO the reason that the Java designers came up with the notion of ... >> having to deal with multiple inheritance of implementation. ... > I always though that the interfaces feature was added as an afterthought to ... > Not that the idea of interfaces is entirely without merit, but Java ...
    (comp.object)
  • Re: Why does python not have a mechanism for data hiding?
    ... find the idea of adding a "private" keyword makes as much sense as ... Well, the designers of C++, Java, and Ada, to name just three very ...
    (comp.lang.python)
  • Re: What are the differences between c++ and Ruby?
    ... Why would you want to implement multiple inheritance in Java??? ... if Java should have had multiple inheritance the designers wouldn't ... have bothered to add interfaces to the language. ...
    (comp.lang.ruby)
  • Re: Poster boy for optional and keyword args together?
    ... &OPTIONAL and &KEY in the same lambda list; again, the keyword ... In a way, this is vaguely similar to Java's interfaces, whereby ... So if key args were passed in a ... In CL's optionals, ...
    (comp.lang.lisp)
  • Re: dynamic type checking - a pauline conversion?
    ... to actually write the code in Java. ... Is the query handled ... One of the problems with Java typing is small differences in interfaces ... array iteration, List iteration, and database query result iteration all ...
    (comp.object)