The Artima Developer Community
Sponsored Link

Legacy Design Forum
Designing with Exceptions



This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


exception hierarchy

Posted by raghu on January 17, 2001 at 3:26 PM

At a package level, u can define hierarchies of exceptions,
and then expose a few 'facade-level' exceptions in the

Allows the client to deal with a small, but well-defined
set of exceptions when dealing with a 'contract'.


> i'm currently working on a large project with many modules/packages.
> does it make sense to categorize the exceptions thrown out of the system by module.
> for example if i have a PERSON module and an INVENTORY module does it make sense to have abstract classes like PersonException and InventoryException and guarantee that any exception thrown out of these modules will be subclasses of these classes. So for any standard java exceptions thrown out of the module you would wrap it with a subclass of the PersonException or InventoryException.

> thanks
> Jaideep



Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us