EHAB in layered app

Topics: Exception Handling Application Block, General discussion
Aug 12, 2009 at 3:30 PM

Three basic layers: ASP.NET UI -> Business -> DAL
Business is deployed as WCF service while DAL is deployed in the same process as Business with a POSSIBILITY to be deployed separately.

EHAB says to use exception shielding between layers, that's fine but the solution EHAB provides via FaultContractExceptionHandler and ExceptionShieldingAttribute
is relevant within WCF physical deployment and not when u just have a separate layer like DAL that's in the same process.
[?? One possibility here is to ALWAYS deploy a layer under WCF umbrella using named pipes ??]

Want to use exception shielding between layers as prescribed to prevent info from escaping a layer: including Business and DAL and still being able to deploy DAL separately without changing exception handling code.
if DAL is deployed under a separate WCF then Business will be receiving soap faults and consequently will be looking for FaultException types in its policies.
if DAL is deployed "in-process" then Business will be receiving just regular exceptions [unless I use a ReplaceHandler to artificially take out the original exception and throw a new FaultException to simulate as if we are running within WCF even though we are not]

I'm seeing those 2 solutions only: Named Pipes or artificial FaultException

Am I missing something here?


Aug 13, 2009 at 6:59 AM


We'll be investigating on this one and get back to you.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.

Aug 14, 2009 at 6:34 AM

I believed you've already covered the possible solutions.  The other thing I tried involved much more effort.  Just adding an idea to your options, Option 2 would limit you to throw a non-generic FaultException as the Replace Handler of the ExceptionHandling doesn't provide support for that.


Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.