• Welcome to Valhalla Legends Archive.
 

Implementing Interfaces

Started by Joe[x86], April 04, 2006, 10:57 PM

Previous topic - Next topic

Joe[x86]

I posted this exact post at x86, but I figured I'd post it here incase someone doesn't know there (or see it).




In my free time in Comp Prog, I'm writing an IRC client, but that's beside the point (mostly). I've written a EventCallbacks interface and implemented it in both SwingUI and ConsoleUI. I want to be able to pass the reference to the UI to the Connection class so that it can fire their callbacks. Do I just pass it as EventCallback UI or as a java.lang.Object, or what?

EDIT -
I may not be able to read this in the morning, so could you drop the answer in an email to [email protected] as well, please? (It's for class, so eh?)
Thanks.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

MyndFyre

EventCallbacks.  That's the point of having interfaces.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Joe[x86]

I know, but I was asking how to pass it. Thanks Myndy.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

MyndFyre

Quote from: J on April 05, 2006, 07:07 AM
I know, but I was asking how to pass it. Thanks Myndy.

That's the point of having interfaces.  You implement interfaces so that you can treat objects as the interfaces they implement.  You don't need to typecast, and you get the benefits of early binding.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Joe[x86]

Ok, I got it implemented and compiled and everything. Thanks guys.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.