Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
None
-
None
-
None
Description
We've got a lot of objects that have a ton of different constructors with a huge number of parameters. Whenever we add a new parameter, existing callers break, and it's sometimes difficult to keep track of which booleans/nulls correspond to which parameter.
I'd like to consider moving to the "Builder" pattern in some of these cases. See http://guava-libraries.googlecode.com/svn/trunk/javadoc/com/google/common/collect/MapMaker.html for an example of this pattern in action. Another good example is the builder API generated by protocol buffers (search for "builder" on http://code.google.com/apis/protocolbuffers/docs/javatutorial.html )
I think this pattern makes code more readable and also allows us to more easily change around the number of arguments in our constructors.
Attachments
Issue Links
- is related to
-
HBASE-2051 Use builder pattern to improve usability of client API
- Closed