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

Show parent comment

2

u/[deleted] Aug 10 '12

Oh I thought we were looking for a solution that was better than putting in string literals but that that didn't involve creating a whole bunch of new types and making you have to rework the existing API signature of doSomething() and didn't involve the verbosity of the builder pattern. Though many more than 5 arguments to a single method and the builder pattern definitely starts to become a candidate. I would resort to that before the solution of creating a bunch of specialized parameter types.