Apr 232012
 

How many times have you created ad-hoc classes, when you need to return multiple values? Would it not be better if your programming language natively would support it, when you want to send a group of values? Java currently has no native support for Tuple’s, but with the use of generics, there’s a solution.

Continue reading »

Mar 022012
 

The builder pattern is great, isn’t it? It lets you create nice immutable classes without the need for multiple constructors and it gives the API users freedom in choosing which arguments they want to use when creating the instance. But what happens when you want to tell the user that she must call one builder method or the other, since it is crucial for the class you’re trying to build? The builder pattern simply doesn’t have such a feature. This post will try to give an alternative solution to this problem.

Continue reading »