I think that the best part of writing a blog is to get comments from my readers.
Because I have learned a lot from my readers, I want to “reward” the best comments, help you to learn new things, and (hopefully) encourage people to leave more comments.
The rules are simple:
- I select X best comments that were left on my blog during the previous month.
- I link to these comments and explain why I chose them.
- If the author of the selected comment has a blog, I add a link to her/his blog as well.
Enough with chit chat. The five best comments of July 2015 are (in chronological order):
The Five Best Comments of July 2015
Jojo asked where he/she should put his/her exception classes. This is a good question because typically exceptions “flow” through multiple layers and it can be hard to find a proper place for them. I hope that my answer helped to clarify this problem.
Joe Gaber asked why I add update methods into my domain objects. It is an important question, because too many people are still using getter and setter methods in their domain objects. My answer explains why I don’t do it.
ArunM asked if we should write our integration tests against the actual development database. This question deserves to be on this list because it reminds us about an important tradeoff:
Our test suite should be as fast as possible, but we must also ensure that our application works when we deploy it to the production environment.
My answer describes how we can create a fast integration test suite and ensure that our application works in the production environment.
shashwat pointed out that my Spring Social tutorial uses deprecated methods. To be more specific, the static getConnection() method of the ProviderSignInUtils class was deprecated when Spring Social 1.1.1 was released. I selected this comment because my answer is useful to the people who want to use Spring Social 1.1.1 or newer.
Sana asked how he/she can write unit tests for a Spring MVC controller method that implements a file upload function. Sana’s comment earned a place on this list because it pointed out a flaw in my tutorial (it doesn’t cover file upload), and I think that my answer is useful to anyone who have to write tests for a file upload function.