Return-Path: X-Original-To: apmail-river-dev-archive@www.apache.org Delivered-To: apmail-river-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 A9C53D0AD for ; Sat, 20 Oct 2012 07:19:46 +0000 (UTC) Received: (qmail 19881 invoked by uid 500); 20 Oct 2012 07:19:45 -0000 Delivered-To: apmail-river-dev-archive@river.apache.org Received: (qmail 19721 invoked by uid 500); 20 Oct 2012 07:19:43 -0000 Mailing-List: contact dev-help@river.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@river.apache.org Delivered-To: mailing list dev@river.apache.org Received: (qmail 19653 invoked by uid 99); 20 Oct 2012 07:19:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Oct 2012 07:19:40 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dan.creswell@gmail.com designates 209.85.212.43 as permitted sender) Received: from [209.85.212.43] (HELO mail-vb0-f43.google.com) (209.85.212.43) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Oct 2012 07:19:35 +0000 Received: by mail-vb0-f43.google.com with SMTP id fq11so1388428vbb.2 for ; Sat, 20 Oct 2012 00:19:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=8vJVAxIYQDyFCcvkkDneJ2ry9F98qI5onnACfdaZDoQ=; b=rXEioNuFp+OKdrXB0eTee3Cu8ohh0d0+UuBx+qHHWP2k2oRfmWfK+KcPqYc9O+Mw60 /iFqFIlNsn/BFcJT98yRVOFy0ihB3UsW5rylCaZxLU8+d4JsCmYbWf/gmXsndz8qGDq1 RVlfDmmaMYVKaniqqRvbTqcersj55tiNrXMXHdsImnsysNsdTR+yTZV6PBr4d5VWKbh0 G0hFHAW67wKZMUH5s98EP6t380al7uM2Y44b+HGudzKERVWQj6CQFibxx5SCBBNB1Ovw TgVLmNqd6fQWZNI7gKmdWdddy2JFFCpxxv4tZH6TQULqAC4ndX1jbu9F3KQaDfsMbPo8 v85Q== MIME-Version: 1.0 Received: by 10.58.95.65 with SMTP id di1mr4668262veb.55.1350717554640; Sat, 20 Oct 2012 00:19:14 -0700 (PDT) Received: by 10.220.13.70 with HTTP; Sat, 20 Oct 2012 00:19:14 -0700 (PDT) In-Reply-To: References: <506C0F1D.7070301@qcg.nl> <1349259525.2932.291.camel@cameron> <506C1310.5010109@qcg.nl> <314C3A25-A518-49DE-A21E-651B40104142@cox.net> <506CA1E0.4050108@qcg.nl> <506ECFE9.9070005@qcg.nl> <17965B3D-7778-4727-9635-1B9E198A1466@wonderly.org> <507FC971.4080107@qcg.nl> <50800794.8030603@qcg.nl> <1350573637.8209.34.camel@cameron> <1350648668.8209.89.camel@cameron> Date: Sat, 20 Oct 2012 08:19:14 +0100 Message-ID: Subject: Re: River exception usage. From: Dan Creswell To: dev@river.apache.org Content-Type: multipart/alternative; boundary=e89a8f503b7209481f04cc78704b X-Virus-Checked: Checked by ClamAV on apache.org --e89a8f503b7209481f04cc78704b Content-Type: text/plain; charset=ISO-8859-1 Or maybe we provide a wrapper in the distribution? I'm with you, my recovery strategies are easier to code with the hierarchy as it is. On 20 October 2012 04:52, Gregg Wonderly wrote: > Each time I use these facilities, there is enough variation in what I want > to do for recovery, that I find it appealing that it is separated so that I > can handle the exceptions individually. > > If you are fonding a common behavior, then a wrapper class or factory like > static method might be what you need. > > Maybe we need to illustrate things with better docs? > > Gregg > > > Sent from my iPhone > > On Oct 19, 2012, at 7:11 AM, Greg Trasuk wrote: > > > > > Hi James: > > > > Is it possible that what you're really looking for is unchecked > > exceptions, a-la Spring's "unified exception hierarchy" for data access > > objects? > > > > Because what I hear you saying is "handling exceptions is a nuisance". > > And you're right, especially when, at the user-interface level, there's > > typically not much you can do about an exception except tell the user to > > try again later. > > > > I have to confess that my personal thinking on checked vs unchecked > > seems to vary over time. Generally I find I'm tending towards unchecked > > exceptions except in cases where I don't feel that I can adequately > > unit-test. Unfortunately that covers most of the network situations > > that Jini/River is good for, so I guess that the exception handling is a > > "cost of doing business". > > > > I've come across some good discussions on the issue at > > http://www.artima.com/intv/handcuffsP.html and > > http://www.mindview.net/Etc/Discussions/CheckedExceptions. > > > > Your concern is valid. I don't know what the best solution is. I'm > > pretty sure that it isn't a single unifying exception based on the fact > > that it's from the same jar file. > > > > Suggestions, anyone? > > > > Cheers, > > > > Greg. > > > > On Thu, 2012-10-18 at 16:28, James Grahn wrote: > >> My concern - the reason for which I raised the issue in the first > >> place - was similarly a "code smell". Individually considered, I > >> agree that the current exception hierarchy is acceptable. There's a > >> sound reasoning behind each part of the hierarchy. Yet my objection > >> is not to the pieces, but the gestalt. > >> > >> Obtain a Javaspace, obtain a transaction manager, get a transaction, > >> read from that space under transaction, write to that space under > >> transaction, commit. How many exceptions must be dealt with for this > >> minimal workflow? Multiply this by the number of times you use > >> Javaspace, and you're either writing a hygiene layer to bring it under > >> control or you're left with verbose, less readable code everywhere > >> River touches. That, too, is a code smell. > >> > >> I suspect that there may be an experiential difference between those > >> building their own services on top of Jini/River, and those using > >> what's already there. Those who wish to add a layer on top of > >> Jini/River very likely must care about every possible exception and > >> handle them all individually. A unified exception hierarchy would > >> not exclude those building services, but would - in my opinion - ease > >> the way for raw usage in applications. > >> > >> An "improved new user experience" is a topic that occasionally > >> surfaces on this list and I believe removing hurdles to raw usage > >> would qualify under that category as well. > >> > >> As for the other major concern: as mentioned before, yes, this is a > >> change that breaks compatibility. It would need to be reserved for a > >> major version change or delayed until something else is going to break > >> backwards compatibility anyway. It would also require a broad > >> consensus for the change (which does not appear to be emerging). > >> > >> I speak only from my own experience, but this change would have been > >> welcomed at the company where I worked. > >> > >> james > >> > >> On Thu, Oct 18, 2012 at 11:20 AM, Greg Trasuk > wrote: > >>> > >>> To be specific, you're talking about (for example) making > >>> TransactionException and LeaseException, and have them both extend > >>> RiverException. I don't like this idea for a number of reasons: > >>> > >>> First, as an old-time Jini-er, I still cling to the idea of Jini as a > >>> set of standards, and River as an implementation of those standards. > We > >>> often talk about this division informally as "the API" or "the Specs", > >>> and "the implementation". So I don't like the idea of the name 'River' > >>> bubbling through the API layer. > >>> > >>> But to be clear, I still wouldn't like it if we defined a > >>> "JiniException". > >>> > >>> I'm probably not going to express my concerns very well - it's more of > a > >>> "code smell" sort of thing. A better architect than me would probably > >>> know the exact name for the API design principle involved, but it seems > >>> like we're mixing the problem domain and the solution domain, where the > >>> exception hierarchy should mostly reflect the problem domain. > >>> > >>> Specifically, to use the exceptions I mentioned above: LeaseException > >>> and TransactionException don't have any commonality or relationship in > >>> the problem domain, except that they are both exceptions. They are > >>> products of two separate specifications that address different and > >>> orthogonal aspects of the distributed programming problem space. To > >>> give them a common ancestor in RiverException would be imposing the > >>> solution-side concept that they happen to both be defined in the same > >>> Apache project. To me, that doesn't seem like good API design. > >>> > >>> I'm all for reasonable exception hierarchy. For example, > LeaseException > >>> is the parent of LeaseDeniedException, LeaseMapException, and > >>> UnknownLeaseException, which makes sense, since they're all types of > >>> exceptions involved in leasing. Similaryly, TransactionException is > the > >>> superclass of CannotAbortException, CannorCommitException, > >>> CannotJoinException , CannotNest Exception, TimeoutExpiredException, > >>> etc, which also makes sense, because they are all types of exceptions > >>> that have to do with transactions. > >>> > >>> In other words, I've looked through the River codebase and from what I > >>> can see, the exception hierarchy already reflects a reasonable > >>> organization of exceptions, and to make the top-level of this hierarchy > >>> extend from a common exception would not make sense. The only common > >>> traits of TransactionException and LeaseExceptions is that they are > both > >>> Exceptions. That commonality is accurately reflected by the fact they > >>> both subclass Exception. > >>> > >>> Cheers, > >>> > >>> Greg. > >>> > >>> On Thu, 2012-10-18 at 09:43, Simon IJskes - QCG wrote: > >>>> On 18-10-12 15:36, Gregg Wonderly wrote: > >>>>>> I see no problem in deriving all river exceptions that are > >>>>>> currently derived from Exception, now from RiverException extends > >>>>>> Exception. This would as far a i can see create no problems in > >>>>>> river as to compatibility. > >>>> > >>>> To make it more clear: To only change river exceptions that are > directly > >>>> extending Exception. > > > --e89a8f503b7209481f04cc78704b--