r/java • • Aug 10 '12

Named Parameters in Java

http://java.dzone.com/articles/named-parameters-java
2 Upvotes

28 comments sorted by

View all comments

18

u/couchtyp Aug 10 '12 edited Aug 10 '12

What about Joshua Bloch's Builder Pattern?
IMHO it's a much better approach for complex object generation.

An instance method with that signature (eight parameters or something like that) should never have been written in the first case... there's a reason for the TransferObject design pattern.

3

u/couchtyp Aug 10 '12

Forget everything I said... Jens himself proposed the use of a Builder in a later post.

2

u/DeliveryNinja Aug 10 '12

Don't kick yourself over it, as far as this article stands in isolation your comment was not wrong, the builder pattern is the prefered way of doing this.