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 six best comments of January 2016 are (in chronological order):
The Six Best Comments of January 2016
- Patrick asked how he can use Spring's default date converter and add global support for a few additional date formats. This sounds like a super useful feature, but unfortunately I don't know the answer to his question. If you know how to do this, could you let me know? By the way, if you can read German, you might want to check out Patrick's blog.
- Eugen wanted to know if there is a way to inject 100 property values into a configuration bean (in a clean way). Well, it turns out that unfortunately that is not possible. I selected this comment on this list because it is important to understand that every decision is a trade-off. Sometimes we might find a solution that has no drawbacks. However, these these situations are extremely rare and often the drawbacks are revealed to us when it is too late change our design.
- Mova asked if there is a way to add social sign-in into a REST API by using Spring Social. This comment is on this list because I assume that is a quite common use case. Unfortunately I have never done this myself, but I hope that I was able to point him/her to the right direction. By the way, if you a know a good blog post that explains how you can do this, could you let me know.
- Hong wanted to know what is the correct way to model a relationship between the Todo entity and the Person entity (the creator or owner). I selected this comment on this list because too many developers would model this by adding a Person field to the Todo class. Even though this might be the right choice, I pointed out that the odds are that these entities do not belong to the same DDD aggregate. If this is the case, making this choice would be a mistake.
- Armagan wanted to know how he/she can fix a java.lang.NoClassDefFoundError that was caused by an incorrect dependency configuration. I selected this comment because Vlad Mihalcea saved the day. I know that a Vlad is a very busy guy. He is a Hibernate Developer Advocate at Redhat, writes an excellent blog, and is writing a book titled: High-Performance Java Persistence. I think that his actions are very good PR to both Hibernate and Redhat.
- Steve told me that he has published a blog post that explains how you can use multiple databases with Spring Boot and Spring Data JPA. I selected this post on this list because it is helps you to solve a very specific problem that is pretty hard to solve. Also, you might want to check out Steve's blog as well.