Proposal: Automatic Resource Management
Stephen Colebourne
scolebourne at joda.org
Sat Mar 7 10:31:31 PST 2009
Neal Gafter wrote:
> On Sat, Mar 7, 2009 at 9:48 AM, Joshua Bloch <jjb at google.com> wrote:
>> Agreed. I like the solution in the "Additional Features" section of the
>> proposal entitled "Retaining suppressed exceptions." If there are no
>> compelling objections, I'll promote this to the body of the proposal in the
>> next revision (and fill in the details).
>
> I don't see how that solves the problem. Are you suggesting that
> everywhere someone handles an exception they should also check for a
> chain of ignored exceptions and log them? That doesn't seem very DRY.
The problem is complicated in a different way in BGGA/JCA control
invocation.
While BGGA/JCA can have a 'manage resource and log exceptions' API as
well as a 'manage resource and ignore exceptions' API, the problem is
which is the default? Developers now have to choose one API over
another. And with the logging case they might well have to write their
own version that writes to their particular logger. More work.
So, while its a Good Thing that you /can/ write your own version of the
API with your own exception handling, it could make the users life
harder. Pros and Cons.
Stephen
More information about the coin-dev
mailing list