Welcome!

Java Authors: Don MacVittie, Maureen O'Gara, Liz McMillan, Walter H. Pinson, III, Yakov Werde

Related Topics: Java

Java: Article

A Strategy for Aspect-Oriented Error Handling

Bringing new challenges to development

When the execute() method of DatabaseFailover is called it will attempt to create a connection getMaximumRecoveryAttempts() or until isConnected(), whichever comes first. When an exception is thrown while trying to get a connection, Prob-lo-Matic is invoked. The DatabaseRetryHandler will be loaded with the DatabaseProblem passed in, and callbacks will be made to DatabaseFailover with new connections that are made by the handler. This approach has given us clean encapsulation of our error-handling logic, and the ability to easily maintain or augment this logic. Using AOP, we can weave this functionality into our system with little impact on the core system code.

Summary
AOP provides developers with a new and exciting methodology that builds on top of OOP concepts, and tries to mitigate some of the inherent problems that OOP brings to large, complex projects. AOP will also bring new challenges to development, especially when it comes to implementing aspects in effective and maintainable ways. Error handling is clearly an important aspect for many applications, especially those with high reliability requirements. An extensible framework for error handling such as Prob-lo-Matic, integrated into applications with AOP, can add a good deal of value to any development effort. Prob-lo-Matic, an open source work in progress, can be downloaded from http://problomatic.sourceforge.net/.

More Stories By Dan Stieglitz

Dan is an independent software consultant in New York. He specializes in designing and developing distributed applications in Java and J2EE.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.