Clarification of JavaLive delegates criticism?
From: Jeffrey T. Smith (Geiger581_at_netscape.net)
Date: 06/22/04
- Next message: Silvio Bierman: "Re: HttpServletResponse doesn't set the header"
- Previous message: sm: "capture the mouse cursor"
- Next in thread: JTK: "Re: Clarification of JavaLive delegates criticism?"
- Reply: JTK: "Re: Clarification of JavaLive delegates criticism?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 21 Jun 2004 20:44:36 -0700
Back when the new J2SE1.5 features were announced, there was a
JavaLive community chat
(http://java.sun.com/developer/community/chat/JavaLive/2003/jl0729.html)
in which Neal Gafter explains the Sun stance on lack of support for
delegates:
... There are serious semantic problems with trying to add delegates
to a language in a consistent way. The main problem is that once you
call the delegate, the original class instance is no longer part of
the call chain, so overriding in the original class no longer takes
precedence over the delegate. ...
Could someone please explain this to me a little more fully? It
sounds like he's saying that delegates cannot follow a subclass call
chain if they are created from an object stored in a superclass
reference, but I can't tell if he means overriding delegates
themselves. I would like to know:
1) What exactly does he mean in less ambiguous terms? (Or maybe just
simpler terms; it's been a while since my college programming
languages course.)
2) What an example of delegates 'failing' like this would look like.
3) What is so significant about this problem.
I am already familiar with the 'Truth about Delegates' dialogue
between Sun and MS and the lack of true type safety of C# delegates,
but not understanding this criticism bothers me. Any help would be
greatly appreciated.
Thanks,
Jeff
- Next message: Silvio Bierman: "Re: HttpServletResponse doesn't set the header"
- Previous message: sm: "capture the mouse cursor"
- Next in thread: JTK: "Re: Clarification of JavaLive delegates criticism?"
- Reply: JTK: "Re: Clarification of JavaLive delegates criticism?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|