Originally posted by Dan Bromberg:
Though I understand the mechanics of using an interface, I'm not fully appreciating its usefulness. I realize they're very important, but why? After all, I'm the one who has to provide all the code to perform the function I require, so how is it benefiting me?
Thanks,
Dan
Even though you have to create the code for the interface implementation methods to work, the code calling your object doesn't have to know how it works, doesn't have to know even what class it is working on, just that the object implements that interface, and that it will work as expected. This is tremendously liberating. Have a look at an article on one of the software design
patterns such as the observer pattern (you use this for instance anytime you code using Swing) and you'll see the power and beauty if this idea.