July 30, 2006

Blog has been moved

This post has been moved to blogspot. No further posts will be made to this location.

Don't kid yourself: that's coupling

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 PM
Comments

Yeah, coupling is cool.

Posted by: Aleks at August 1, 2006 10:08 AM

I 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 AM

Just messing with you a bit. Hope you don't mind :)

Posted by: Aleks at August 2, 2006 10:36 AM
Due to the proliferation of comment spam, I’ve had to close comments on this entry. If you would like to leave comment, please use one of my recent entries. Thank you and sorry for any inconvience caused.