ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | dods List | November 2001 Index

<--  Date Index  --> <--  Thread Index  -->

Dods: Handling exceptions at creation or access time?


I've handled DO exceptions in my business layer two different ways,
and was wondering if anyone had an opinion as to which was better.

A call to a DO's getXxx method could throw a DataObjectException,
since you don't know which of those calls could be the first to load
the data. You could:

1. throw an exception from each of your BO getXxx methods, since you
don't know which if those calls would actually load the data, or
2. call the DO's loadData() method in the constructor to load the data
at creation time, then catch the exception in the BO's getXxx methods.

#2 makes exception handling easier for a class using the BO, since
it only has to deal with an exception at creation, but I'm wondering
if it could cause any other problems.

How do other people handle this?  Thanks for your input.

     Jeff





<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.