Cassio Posted May 23, 2004 Posted May 23, 2004 (edited) Hi! I found these articles about Delegates. In this one Sun is explaning why Java doesnt support Delegates and will never do. http://java.sun.com/docs/white/delegates.html And on this one is Microsoft response to Sun's white paper. http://msdn.microsoft.com/archive/default.asp?url=/ARCHIVE/en-us/dnarvj/html/msdn_deltruth.asp I guess I was pretty convinced by Microsoft arguments. So what do you guys think? Edited May 23, 2004 by Cassio Quote Stream of Consciousness (My blog)
*Experts* Nerseus Posted May 23, 2004 *Experts* Posted May 23, 2004 I think the argument can be summed up with this statement, from MS: The truth is that delegates are simpler than inner classes for event scenarios. When I want to maintain something, I want simplicity. I don't care about saving 2 nanoseconds on an event. Generally speaking, whatever code is running in the event is going to be significantly longer than the time it takes to get into the function/method. I'll agree that delegates are a bit weird (a new Type and they have global scope) and confuse most people at first. Truth is, most Windows programmers won't use them except as event handlers for their controls. If you invest some time in learning "true" OO programming, you will find many more uses for them - they form the basis for notification between components. As the recent "Design Patterns in C#" book mentions, you can use interfaces to accomplish the same thing, but delegates make the code "cleaner" - that is, easier to view and understand. -nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.