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 029CB7F8F for ; Sun, 2 Oct 2011 14:38:47 +0000 (UTC) Received: (qmail 39657 invoked by uid 500); 2 Oct 2011 14:38:46 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 39557 invoked by uid 500); 2 Oct 2011 14:38:46 -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 39549 invoked by uid 99); 2 Oct 2011 14:38:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Oct 2011 14:38:46 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=GAPPY_SUBJECT,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.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; Sun, 02 Oct 2011 14:38:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scarlet.be; s=scarlet; t=1317566297; bh=ciM2aQnyZt6VdOdCX6lWZpGXf/g1zrZ6X9qiwOyt+Qw=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=ivmcJXzUkb+oWSabFJrEUhaJYJ5rYvl1Ts8gH7gbQHoc3cAwvsP70uDUiYDAoURBY Zl94W+sbT/IpRK3ybVYg4q2VIGbR2hMnNiOe85mJSORJ5tU9uhh+Ov5jK6AoHeQ3qb W+amTrfqNYArY9Vh6gShfZVJ4UkuhPpCNfgxFW/o= Received: from mail.harfang.homelinux.org (ip-213-49-249-14.dsl.scarlet.be [213.49.249.14]) by hel.is.scarlet.be (8.14.5/8.14.5) with ESMTP id p92EcGBU006607 for ; Sun, 2 Oct 2011 16:38:17 +0200 X-Scarlet: d=1317566297 c=213.49.249.14 Received: from localhost (mail.harfang.homelinux.org [192.168.20.11]) by mail.harfang.homelinux.org (Postfix) with ESMTP id 2E41661CCB for ; Sun, 2 Oct 2011 16:38:16 +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 5qhE5+n0o2rL for ; Sun, 2 Oct 2011 16:38:14 +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 8EF01617DD for ; Sun, 2 Oct 2011 16:38:14 +0200 (CEST) Received: from eran by dusk.harfang.homelinux.org with local (Exim 4.76) (envelope-from ) id 1RANBG-0002Rt-9B for dev@commons.apache.org; Sun, 02 Oct 2011 16:38:14 +0200 Date: Sun, 2 Oct 2011 16:38:13 +0200 From: Gilles Sadowski To: dev@commons.apache.org Subject: Re: [math] rename o.a.c.m.linear.SingularMatrixException to SingularLinearOperatorException Message-ID: <20111002143813.GT17021@dusk.harfang.homelinux.org> Mail-Followup-To: dev@commons.apache.org References: <4E877BB0.7020803@gmail.com> <4E87FDA1.5000409@gmail.com> <20111002124334.GS17021@dusk.harfang.homelinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Hello. > took me some time to figure out what your [1] meant, but I think I got > it (or did I?)... I'm a bit on the slow side. The first time I saw this quote, it also took me a lot of time to understand what they were talking about. Indeed, the mere fact of having a hard time understanding it indicates that the quote perfectly illustrates the point! :-) > > > > +1 also because it is the standard style in Java (for better or worse). > > > > As I've pointed out somewhere else[2], to avoid an avalanche of exception > > classes[3], the default assumption should probably not be that every concept > > embodied in a Java class must have its own set of subsumed exceptions. > > Rather, failures are more of a concern that is cross-cutting along possibly > > unrelated (algorithm) classes. E.g. even if an operator is not always a > > linear operator, couldn't it be that using one or the other could trigger a > > "SingularOperatorException" (where the "ExceptionContext" would be used to > > more fully describe the specifics of each case)? > > > I understand that appropriate use of exceptions is in fact a quite > delicate design issue, which is far beyond my designing skills, so I'm > ready to take anything which sounds good to more experienced people. > Only, in the present case, I have a hard time figuring out from the > above discussion what *is* the best solution. > > If I understood correctly, Phil would like to have two separate > exceptions, SingularOperatorException and SingularMatrixException, > with no inheritance link Conceptually, the exception are related; however, as we already discussed, it is difficult to make them share an implementation. It would have been possible by having (marker) interfaces, but that seems to be overkill for something that most of the time ends up in aborting the program... > Gilles leans on the one exception+context side (since a Matrix is a > linear operator therefore an operator). So if I understand Gilles > correctly, we would rename SingularMatrixException to > SingularOperatorException, and throw this exception each time we try > to invert an operator in the widest sense (linear or not, matrix or > not). I actually like that simple option. Also, I would like to remind > you that the present exception does *nothing* but display a standard > message (there is no state variable in the present > SingularMatrixException). > > Do you think that the discussion is well summed up? Almost (cf. below). > Or can you think > of a better way to implement things? For the time, I see two options > 1. Keep SingularMatrixException, add SingularOperatorException > 2. Rename SingularMatrixException to SingularOperatorException and use > it more widely (and possibly move it to a more general package). Use > context if needed. > 3. any other idea? I hadn't thought of it, but in the line of "leaner is better", I like number 2. However, in some application contexts, people would probably prefer to keep the "Matrix" part of the exception name, thus number 1. Best, Gilles --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org