The problem I see is the amount of code that has to be copy-pasted, due to Java's lack of traits. If you want to write code like this, do yourself a favor and write it in Scala instead.
Java's lack of traits does indeed suck, and I would definitely prefer Scala over Java, but the only copy-pasting you need to do is of delegation methods. It's duplicate boilerplate, but it's not duplication of logic.
Not necessarily verbose, but moreso a larger codebase. Besides -- all of these extra classes are invisible with D.I. anyway right? ;)
You're right, it will grow the codebase more than making the code verbose. And the code will probably be more readable.
But have you actually used this in practice ? Is it tractable ?
I'm actually thinking of trying this on (a rather old version of) C#, since I'm writing quite lots of code for (an old version of) mono. If only I could use F# sigh
I come from a C# background, learning Java, and I just so happen to be following that process. I don't remember where I picked it up (something in the Spring docs?), but it seemed like a good idea.
Short version: yea, it works pretty well.
Long version is at this shameless blog plug (no ads): http://itgoon.blogspot.com/2009/08/javas-lots-of-little-file...
Re:Next-gen Java Programming Style
by shiranaihito on Monday August 10, 2009 @11:10AM
(#753083)
The proliferation of classes should be manageable if you package them neatly.
On the one hand I understand where the author wants to go : by implementing many many interfaces you eventually sort of "emulate" duck-typing, while at the same time reinforcing type safety (specially when it comes to String).
On the other hand, it sounds like a good way to make something that was verbose to begin with even more verbose... but maybe I'm mistaking. I don't do much Java recently (some GWT/GXT sometimes), but I will probably give it a practical try...