Design: Custom Exception Usage
- From: Terrence Jones <TerrenceJones@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 8 Apr 2008 01:08:26 -0700
I have a design question that I would like to get some opinions on.
I have a class (ClassA) that uses a custom exception (ExceptionA). The
class and exception are defined together in one assembly.
I have ClassB that uses ClassA. If an ExceptionA is thrown from ClassA, the
users of ClassB may need to catch it.
I would prefer the users of ClassB to not need to reference ClassA for the
sole purpose of catching its exceptions. I was thinking of making a subclass
ExceptionB : ExceptionA (direct encapsulation) and catching and rethrowing.
I think this is too much effort. What are your thoughts on situations like
this?
Thanks
.
- Follow-Ups:
- Re: Design: Custom Exception Usage
- From: DSK Chakravarthy
- Re: Design: Custom Exception Usage
- From: Anthony Jones
- Re: Design: Custom Exception Usage
- Prev by Date: Re: Business Object Collection And DataGridView
- Next by Date: Re: Design: Custom Exception Usage
- Previous by thread: Stainless Steel Pendant KP1140 Wholesale Store
- Next by thread: Re: Design: Custom Exception Usage
- Index(es):
Relevant Pages
|
Loading