Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Re: Exception handling framework

Essentially, there are two problems we need to address:

1. Throwing on an exception after handling it (instead of
   logging or absorbing it).
2. Reinstating the checked exception at a higher level.
   Somewhat implicit in here is the requirement to maintain
   the original contracts to throw business exception (note that it
   is a problem only with the aspects that summarily capture 
   all exception types, such as transaction management, to introduce
   crosscutting functionality).

For the first part any mechanism to demote a checked exception
to a runtime exception will do, hence "declare soft" will do
fine. I prefer a concern-specific runtime exception instead
of generic SoftException. 

For the second part, an aspect such as shown in my posting does
the job and it can work with SoftException as well.

-Ramnivas

--- Macneil Shonle <mshonle@xxxxxxxxxxx> wrote:
> > > Historically the issue with this approach has been losing
> > > the traceability of compile-time type checking.
> >
> > For reusable and widely crosscutting aspects (such as transaction
> > management example in my email), since the advice is unaware of
> > business exceptions, there is no other way but to wrap
> > the checked exception in a runtime exception.
> 
> How does "declare soft" fit into this whole discussion? In my opinion
> Java's current exception enforcement is bad because it forces you to
> break
> properties of layered software: sometimes you want an exception
> generated
> at the bottom layer to only be known by the top-most layer, without
> any of
> the layers inbetween having to know about it.
> 
> Thanks,
> Macneil
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com


Back to the top