This post has been moved to blogspot. No further posts will be made to this location.
One of the books that I was reading (I think that it was Lighter, Faster Java) was talking about coupling. When working with a language like Java, it's a good idea to try and deal with interfaces instead of concreate classes. Especially with method signatures. But that's another rant about the joy's of the Java Collections.
Back on topic. Working with interfaces is a good idea, just don't kid yourself when you are doing it. For example, if you have some code like this:
Set mySet = new HashSet();
it is no less coupled to HashSet than code that is written like this:
HashSet mySet = new HashSet();
So, using interfaces in method calls / signatures: good. Using interfaces where you create a new concreate object (not using a factory or something like that): pointless.
Posted by jim at July 30, 2006 01:43 PMYeah, coupling is cool.
Posted by: Aleks at August 1, 2006 10:08 AMI still can't figure out if you're making fun of me... all signs point to "Yes" though...
Posted by: Jim at August 2, 2006 08:21 AMJust messing with you a bit. Hope you don't mind :)
Posted by: Aleks at August 2, 2006 10:36 AM