Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3767E11F24 for ; Mon, 12 May 2014 02:30:43 +0000 (UTC) Received: (qmail 66193 invoked by uid 500); 12 May 2014 00:41:15 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 65868 invoked by uid 500); 12 May 2014 00:41:15 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 65600 invoked by uid 99); 12 May 2014 00:41:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 May 2014 00:41:15 +0000 Date: Mon, 12 May 2014 00:41:15 +0000 (UTC) From: "Andrew Purtell (JIRA)" To: dev@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (HBASE-2597) Use "Builder" pattern instead of many-argument constructors MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-2597?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Purtell resolved HBASE-2597. ----------------------------------- Resolution: Won't Fix Assignee: (was: Todd Lipcon) Not going to happen. Could reopen if there is active interest (aka a patch soon forthcoming) > Use "Builder" pattern instead of many-argument constructors > ----------------------------------------------------------- > > Key: HBASE-2597 > URL: https://issues.apache.org/jira/browse/HBASE-2597 > Project: HBase > Issue Type: Improvement > Components: Client > Reporter: Todd Lipcon > > 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. -- This message was sent by Atlassian JIRA (v6.2#6252)