Published at: 08:08 am - Sunday August 19 2012
I wrote before about how you can emulate named parameters in a Java, either using methods or a builder. There is another approach, which already got mentioned in the comments. On the usage side it looks like this: doSomething4(new ParameterObject() {{ name = "Alfred E. Neumann"; [...]
Published at: 08:08 pm - Sunday August 05 2012
In the last installment of this blog I wrote about a way to fake Named Parameters in Java. As so often there are many ways to do this, so here comes another one. Instead of static methods producing value objects for each parameter you can use a single parameter object that happens to be a [...]
Published at: 11:07 pm - Sunday July 29 2012
I lately came across some code that looked like this: o.doSomething1( "Alfred E. Neumann", "http://blog.schauderhaft.de", 42, "c:\\temp\\x.txt", 23); Things were actually worse since there where about 20 or 30 such calls and there was no hint what so ever to the difference in meaning of [...]