Site Archives coding

Neglected classes in Spring – Part II


If you have worked with Spring 2.5 annotation based web MVC framework you know that it allows you to freely design you controller method signatures:
@RequestMapping(value = “users”, method = GET)
public String showUsers(Model model) {
model.addAttribute(“users”,
userManagement.getUsers());
return “users”;
}
As you can see we use a parameter of type Model that will [...]

Neglected classes in Spring – Part I


This blog post will be the starting point of a series of posts regarding often neglected classes in Spring. There are two main reasons for me to write this series. First, I really would like to unveil a set of classes that deserve some deeper attention as they make developer’s life a lot easier inside [...]

Leveraging annotations in Java code


In the last few days it I happened to two short discussions on Twitter with Adam Bien (not really a discussion) and Keith Donald (slightly more intesive) on distinct but yet somehow related topics regarding the use of annotations in Java.
Using the right tool for the job
Keith answered my following tweet i posted after revisiting [...]

Using Spring’s @Configurable in three easy steps


As you might not be aware of, besides injecting dependencies into beans Spring is able to inject dependencies into objects that are not instantiated by Spring. This becomes especially handy if you’re stuck to Domain Driven Design leveraging a rich domain model over an anemic one. As there’s been some buzz around that functionality on [...]

Achieving application modularity with Hera


The latest episode of the JavaPosse podcast presents a session of the this year’s JavaPosse roundup on Scala and application modularity. Although I attended the conference I did not attend this session, which is rather sad in retrospect as the attendees discuss a lot of things I also deal with.
As a note aside I want [...]

Unit testing annotation based Spring MVC controllers


Although it took me a while to get used to them, I now pretty much like the annotation based programming model for controllers in Spring MVC. The major advantage over the traditional inheritance based approach is, that the methods, that are bound to requests are simple public methods, that can easily be unit tested.
So while [...]

Integrating Hades into existing applications


Today I’ve got an email by Thomas Braun who considered to play around with Hades. He is facing an application with an existing data access layer based on Spring’s HibernateDaoSupport class. This raised the question of how to integrate Hades into the app without changing existing code.
Thomas was using AnnotationSessionFactoryBean to create the SessionFactory from [...]

Clean Code – Review, Part I


As I have twittered already, I am reading “Clean Code” by Robert C. Martin right now. I expected the book to be a very fundamental one. Although there are a few parts I do not entirely agree with, I just rummaged throught chapter 11 “Systems” on my way home and was surprised how condensed Robert [...]