An Aspect for Idiom-based Exception Handling
نویسندگان
چکیده
The last couple of years, various idioms used in the 15 MLOC C code base of ASML, the world’s biggest lithography machine manufacturer, have been unmasked as crosscutting concerns. However, finding a scalable aspect-based implementation for them did not succeed thusfar, prohibiting sufficient separation of concerns and introducing possibly dangerous programming mistakes. This paper proposes a concise aspect-based implementation in Aspicere2 for ASML’s exception handling idiom, based on prior work of join point properties, annotations and type parameters, to which we add the new concept of (local) continuation join points. Our solution takes care of the error value propagation mechanism (which includes aborting the main success scenario), logging, resource cleanup, and allows for local overrides of the default aspect-based recovery. The highly idiomatic nature of the problem in tandem with the aforementioned concepts renders our aspects very robust and tolerant to future base code evolution.
منابع مشابه
Refactoring Idiomatic Exception Handling in C++: Throwing and Catching Exceptions with Aspects
Aspect-oriented programming can be used to modularize crosscutting concerns to improve the maintainability of large systems. Exceptions cross-cut legacy applications and are often implemented in idioms which cannot be globally enforced. We describe an aspect-oriented approach for throwing exceptions in place of the “return code idiom”, and discuss using aspects to handle those exceptions in a m...
متن کاملImplementing Coordinated Exception Handling for Distributed Object-Oriented Systems with AspectJ
Exception handling is a very popular technique for incorporating fault tolerance into software systems. However, its use for structuring concurrent, distributed systems is hindered by the fact that the exception handling models of many mainstream object-oriented programming languages are sequential. In this paper we present an aspect-based framework for incorporating concurrent exception handli...
متن کاملImplementing Coordinated Error Recovery for Distributed Object-Oriented Systems with AspectJ
Exception handling is a very popular technique for incorporating fault tolerance into software systems. However, its use for structuring concurrent, distributed systems is hindered by the fact that the exception handling models of many mainstream object-oriented programming languages are sequential. In this paper we present an aspect-based framework for incorporating concurrent exception handli...
متن کاملA Quantitative Study on the Aspectization of Exception Handling
It is usually assumed that the implementation of exception handling can be better modularized by the use of aspect-oriented programming (AOP). However, the trade-offs involved in using AOP with this goal are not yet wellunderstood. To the best of our knowledge, no work in the literature has attempted to assess whether AOP really promotes an enhancement in well-understood quality attributes othe...
متن کاملStatically-Scoped Exceptions: a Typed Foundation for Aspect-Oriented Error Handling
Aspect-oriented programming systems such as AspectJ provide mechanisms for modularizing crosscutting error-handling concerns. However, AspectJ’s advice does not integrate well with Java’s checked exception mechanism. Furthermore, conventional exception-handling facilities such as AspectJ’s share the problem of accidental exception capture due to the dynamic nature of exception-handling semantic...
متن کامل