> Right, but in reality the general practice is that you never declare a
> domain exception to extend RuntimeException, since it's not a checked
> exception and it's not recoverable, why do you bother to have a
> subclass(you are not gonna to check it, right?), why don't you just
> use RuntimeException directly?

Java itself has a few dozen exception classes which extend
RuntimeException, so it's not that unusual. When the subclass
exception is finally caught, it may be beneficial to recognize it as a
JBookTraderException, rather than as a more generic RuntimeException.

> Also in our code, we are recoverable from many places from my opinion,
> and at least we want to notify users about them (i.e.
> MainFrameController, StrategyTableModel, TradingSchedule etc.), making
> JBookTraderException a runtime exception surely wouldn't do us any
> good in these cases.
> My suggestion is that we should still have our domain exception, and
> for those un-recoverable special cases we should just use
> RuntimeException directly. What do you think?

I agree with your suggestion. In those cases where action can be
taken, it's better to throw a checked exception. Would you like to go
over the code and make the corresponding adjustments, Yueming?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"JBookTrader" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jbooktrader?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to