Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-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 DA29B109A7 for ; Mon, 13 Jan 2014 21:36:27 +0000 (UTC) Received: (qmail 23340 invoked by uid 500); 13 Jan 2014 21:21:32 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 23232 invoked by uid 500); 13 Jan 2014 21:21:27 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 23028 invoked by uid 99); 13 Jan 2014 21:21:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jan 2014 21:21:00 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of thomas.neidhart@gmail.com designates 74.125.82.178 as permitted sender) Received: from [74.125.82.178] (HELO mail-we0-f178.google.com) (74.125.82.178) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jan 2014 21:20:52 +0000 Received: by mail-we0-f178.google.com with SMTP id t60so7117033wes.37 for ; Mon, 13 Jan 2014 13:20:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=olrUzEOfeydsUmLcWIVE5oochtsymLQ4DJnLcTO78qY=; b=rrKSz7O0kF240P07liPsI3I7eXbKNw7zW+GN3UgVYKe8aUnGcE/CghyivI2r8C9hKU me8uMZnv95YALII+dCLcvuNCtLiS8Hyh11WO3RiAI/dKwXSSTIdKv0YpCBx3XyY94uwv 45icQTYHdEFUYfH/wj06ml1hXOqLj2eDLDJtQARQEZRm55vlhMI6ZfUwTFhVto+muScp Wk3xekNrorfOA7Uh9fNy8cW/IAnvlAwrtRI9lwuTzrfIGcvAkSIHvwn5f7hY1j3OU2Mf MsyGOjP//TM5zv7in3oVydbNJeS4E2X/8vaBL0hiM/En4WSa4qAGpTEOqqfz1mghVlPA V74g== X-Received: by 10.180.221.38 with SMTP id qb6mr2103278wic.26.1389648032135; Mon, 13 Jan 2014 13:20:32 -0800 (PST) Received: from [192.168.1.2] (ip-81-11-195-25.dsl.scarlet.be. [81.11.195.25]) by mx.google.com with ESMTPSA id pl7sm12588812wjc.16.2014.01.13.13.20.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Jan 2014 13:20:31 -0800 (PST) Message-ID: <52D4589D.8020109@gmail.com> Date: Mon, 13 Jan 2014 22:20:29 +0100 From: Thomas Neidhart User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Commons Developers List Subject: Re: [math] Suggestion to refactor BinomialConfidenceInterval References: <52D2A0B1.1020303@gmail.com> <52D2D4FC.2050607@gmail.com> In-Reply-To: <52D2D4FC.2050607@gmail.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 01/12/2014 06:46 PM, Phil Steitz wrote: > On 1/12/14, 6:03 AM, Thomas Neidhart wrote: >> Hi, >> >> we had some preliminary discussion about changing the >> BinominalConfidenceInterval class in MATH-1086. >> >> Right now the class provides some non-static methods to create various >> ConfidenceIntervals, and I was proposing to change them to be static. >> >> Another option would be to allow sub-classing by defining an interface >> (or abstract base class) to create such an interval: >> >> public interface BinomialConfidenceInterval { >> ConfidenceInterval createInterval(int numberOfTrials, >> int numberOfSuccesses, >> double confidenceLevel); >> } >> >> With subclasses for the individual methods, e.g. Wilson or >> NormalApproximation. > > I am +1 for this. Calling conversion of current methods to static > 0) and above 1), seems to me there are two other reasonable options: > 2) do nothing - leaving the methods non-static preserves extensibility > 3) use an abstract class instead of interface - I think we may be > getting carried away with preference for this approach and I think > it would be silly in this case > > So my preference order is 1), 0), 2), 3). I guess TestUtils is OK > as the home for the static convenience methods in cases 1), 2), 3). Option 3 would make sense to avoid duplicating the checkParameters method which is currently used by all the different getXXXInterval methods. But we can also make it package private and static in TestUtils. Thomas --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org