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 9EBAFC2A1 for ; Sat, 9 Jun 2012 00:49:18 +0000 (UTC) Received: (qmail 60053 invoked by uid 500); 9 Jun 2012 00:49:18 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 59721 invoked by uid 500); 9 Jun 2012 00:49:18 -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 59710 invoked by uid 99); 9 Jun 2012 00:49:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Jun 2012 00:49:18 +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 (athena.apache.org: local policy) Received: from [193.74.71.26] (HELO hel.is.scarlet.be) (193.74.71.26) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Jun 2012 00:49:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scarlet.be; s=scarlet; t=1339202929; bh=2DUJU347F5ZetsjOXCmJhinO01J3N+m7kI+2JKoHeqk=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=u3Sdiau6Ux0rpPFgLBNLS9A9kLjT54rErtSbzEB+2fZMobgE5uP4VMP8Y9ebjVzwT T3AwRzxqKOCyaRJ+mWOBjcmpnrZ8e8s0+GYo7zx9r8sKaHU3YJvEK5wgJ7pF9Ij6rB nLe3nulc6E/jfZA2n3vq51ftiucY5pD84L70X1uo= Received: from mail.harfang.homelinux.org (ip-213-49-255-225.dsl.scarlet.be [213.49.255.225]) by hel.is.scarlet.be (8.14.5/8.14.5) with ESMTP id q590mmMw010584 for ; Sat, 9 Jun 2012 02:48:49 +0200 X-Scarlet: d=1339202929 c=213.49.255.225 Received: from localhost (mail.harfang.homelinux.org [192.168.20.11]) by mail.harfang.homelinux.org (Postfix) with ESMTP id 8FF01619F7 for ; Sat, 9 Jun 2012 02:48:48 +0200 (CEST) Received: from mail.harfang.homelinux.org ([192.168.20.11]) by localhost (mail.harfang.homelinux.org [192.168.20.11]) (amavisd-new, port 10024) with ESMTP id l5ZNHstZZXtg for ; Sat, 9 Jun 2012 02:48:47 +0200 (CEST) Received: from dusk.harfang.homelinux.org (mail.harfang.homelinux.org [192.168.20.11]) by mail.harfang.homelinux.org (Postfix) with ESMTP id 0A10261760 for ; Sat, 9 Jun 2012 02:48:46 +0200 (CEST) Received: from eran by dusk.harfang.homelinux.org with local (Exim 4.77) (envelope-from ) id 1Sd9rC-0003U1-L7 for dev@commons.apache.org; Sat, 09 Jun 2012 02:48:46 +0200 Date: Sat, 9 Jun 2012 02:48:45 +0200 From: Gilles Sadowski To: dev@commons.apache.org Subject: Re: [Math] HarmonicFitter and GaussianFitter Message-ID: <20120609004845.GI10938@dusk.harfang.homelinux.org> Mail-Followup-To: dev@commons.apache.org References: <20120609000042.GG10938@dusk.harfang.homelinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120609000042.GG10938@dusk.harfang.homelinux.org> X-Operating-System: Tiny Tux X-PGP-Key-Fingerprint: 53B9 972E C2E6 B93C BEAD 7092 09E6 AF46 51D0 5641 User-Agent: Mutt/1.5.21 (2010-09-15) X-DCC-scarlet.be-Metrics: hel 20002; Body=1 Fuz1=1 Fuz2=1 X-Virus-Scanned: clamav-milter 0.97.1-exp at hel X-Virus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org On Sat, Jun 09, 2012 at 02:00:42AM +0200, Gilles Sadowski wrote: > Hi. > > I'm a bit annoyed that "HarmonicFitter" and "GaussianFitter" suffer from the > same design flaw as "PolynomialFitter", namely that it is possible to call > the non-overridden "fit" with an argument that is not of the right type > (i.e. "HarmonicOscillator.Parametric" and "Gaussian.Parametric", > respectively). > However we cannot simply remove them as in MATH-800, since those classes > perform non-trivial computations. > One possibility is to override the "fit" methods that should not be used, > and have them throw an exception. > > What do you think? > Which exception would be most appropriate? This doesn't work (I should have tested it before sending the message...). However, I think that using generics might solve the problem: --- public class CurveFitter --- And thus --- public class GaussianFitter extends CurveFitter --- Then, we could keep "PolynomialFitter". OK for this change? Regards, Gilles --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org