Not a single mention of Guice or even dependency injection? Seems like a gaping omission in a guide that claims to be about "modern" Java.
An Opinionated Guide to Modern Java Development, Part 1
41–50 of 402 posts
Re: An Opinionated Guide to Modern Java Development, Part 1
#42I like the changes in Java 8, but I'm concerned about Java fragmentation between Oracle/OpenJDK and Android. It seems Android is stuck on Java 1.6 (since Dalvik is not "true Java" and is more like a VM that happens to implement a language very similar to Java 1.6). There's now a huge gap between 1.6 and 1.8. It's not just syntax like lambda and default methods. It's also the supporting API changes in collections (str…
Re: An Opinionated Guide to Modern Java Development, Part 1
#43Not a single mention of Guice or even dependency injection? Seems like a gaping omission in a guide that claims to be about "modern" Java.
I'm looking at you, Spring.
Re: An Opinionated Guide to Modern Java Development, Part 1
#44One of my opinions these days on javadoc is that you should be minimalist. Have nothing to say about the return type? Don't add @return. Same for @param. Just a sentence about the method/field/class? Just a single line /* * ... */ is fine. Have nothing of value to say on a method/field/class (e.g. a getter), don't add javadoc at all. I'm growing weary of large files with tons of redundant javadoc lines to make some c…
Seconded. I always bristle when I see javadocs that include things like 'returns an object of [x] type that...' You're dealing with strong types, the signature provides all this information already. That, combined with good variable names, should do a lot of the documentation for you. If you wanna document a method, document what problem it solves. Document any gotchas (or better yet, redesign them out o_~). Don't ju…
1) You're writing javadoc for something that isn't really a public facing api. In that case, I agree, remove the @return. Perhaps even remove that / * * and convert it to / *. It shouldn't be officially documented.
2) It is public facing api. It may seem that the @return is redundant, but there's really a better way to document it.
Re: An Opinionated Guide to Modern Java Development, Part 1
#45Not a single mention of Guice or even dependency injection? Seems like a gaping omission in a guide that claims to be about "modern" Java.
Dependency injection has seen its day. The gains promised by DI/IoC containers tend to be outweighed by the complexity they introduce. I'm looking at you, Spring.
Re: An Opinionated Guide to Modern Java Development, Part 1
#46I'm using Java for the first time because of Android. I had played with Java when it first came out but have stayed with C/C++/C# for almost everything. I have to say that my Java experience isn't as unpleasant as I thought it would be. I always thought C# is what Java should have been but after learning a little idiomatic Java the reality is quite okay, really.
Re: An Opinionated Guide to Modern Java Development, Part 1
#47Earlier quoted context omitted.
Genuinely curious : i've been playing with dependency injection, and really never got to understand the true use of it. I mean, what's the point of being able to replace an implementation outside the source code itself ? You'd still have to extensively test the thing and recompile it... Is there more to it than just being able to replace a class by its mock up, for unit testing ?
I think the point is that you don't want to be instantiating (and thus configuring) a dependency at the site where it is used. The code in class Foo should be limited to implementing Foo, not instantiating and configuring its dependency Bar.
Re: An Opinionated Guide to Modern Java Development, Part 1
#48I like the changes in Java 8, but I'm concerned about Java fragmentation between Oracle/OpenJDK and Android. It seems Android is stuck on Java 1.6 (since Dalvik is not "true Java" and is more like a VM that happens to implement a language very similar to Java 1.6). There's now a huge gap between 1.6 and 1.8. It's not just syntax like lambda and default methods. It's also the supporting API changes in collections (str…
I'm not aware of any plans to support Java 8 yet, but I haven't been looking.
Re: An Opinionated Guide to Modern Java Development, Part 1
#49Earlier quoted context omitted.
I think the point is that you don't want to be instantiating (and thus configuring) a dependency at the site where it is used. The code in class Foo should be limited to implementing Foo, not instantiating and configuring its dependency Bar.
So why not just pass its dependency as a constructor argument?
http://en.wikipedia.org/wiki/Dependency_injection#Constructo...
Re: An Opinionated Guide to Modern Java Development, Part 1
#50I'm a little skeptical of this. More like the developer in the future uses Gradle. Usually when I go to a project's home page, I see documentation on how to include the Maven dependency, not the Gradle dependency. It's pretty obvious how to convert one format to the other, but my point is I think most people are using Maven.