4 ms·
I have to admit that the 5th point (Use many, many objects with many interfaces) leaves me thinking... On the one hand I understand where the author wants to g
by Xixi 17y ago
I have to admit that the 5th point (Use many, many objects with many interfaces) leaves me thinking...
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...
- fogus 17y agoNot necessarily verbose, but moreso a larger codebase. Besides -- all of these extra classes are invisible with D.I. anyway right? ;)
- Xixi 17y agoYou'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
- shiranaihito 17y agoThe proliferation of classes should be manageable if you package them neatly.
- itgoon 17y agoI 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-files.html http://itgoon.blogspot.com/2009/08/javas-lots-of-little-file...
- jrockway 17y agoThe 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.
- sciolizer 17y agoJava'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.