The Logic layer is where we implement the application logic for our software. It calls functions in the Library layer and combines them to provide useful functionality for the user.In the Logic layer, we can define our exceptions according to the Fatal / Recovered categories.
The class hierarchy above shows how I would organize the fatal and the recovered exceptions in most of the languages that I use. The UnrecoveredException class represents unrecovered exceptions that happen in a function. These are exceptions that mean that the state was not recovered to the state before the function was called. The RecoveredException represents all exceptions that were recovered. There also should be a FatalError class, which should usually result in termination of the program. Since we have the java.lang.Error class in Java, we can subclass this for the FatalError class.
|
Contents |