Unplugging Components using Aspects

Abstract

Normally, Aspect-Oriented Programming (AOP) is used for plug-ging and not for unplugging. Aspects (concerns) are weaved into a system, thus providing a modularized way to add crosscutting fea-tures to a base program. For example, given a base program without logging and given a logging aspect, the AOP weaver produces from the untangled code an executable with the desired crosscutting log-ging behaviors. The benefit is that the logging code is modularized, e.g., you can easily activate or deactivate logging. However, what if a legacy system written without AOP technology already con-tains logging functionality hard-coded in the base program? How do you deactivate logging then? In this paper, we explore the use of AOP for writing aspects that transform exiting hard-coded calls into plugs that can be used to retarget the client to use other sub-components. Applying AOP for unplugging has potential usage in connection with components. You are given a monolithic system. You apply AOP to non-intrusively decouple the system’s compo-nents. You may then replace some of the legacy components with alternative third-party components.

Publication
WCOP'03
David H. Lorenz
David H. Lorenz
Dept. of Mathematics and Computer Science

Senior Faculty at Open University