Aspect-Oriented Programming (AOP) is considered a way to manage increasing complexity by localising common design elements, known as crosscutting concerns, into their own separate module – referred to as an aspect – and combining them in a “plug and play” fashion with multiple objects either during compilation or at runtime. A single aspect can then advise many different objects (Elrad et al., 2001). An aspect can be defined as a unit of modularity, encapsulation and abstraction for the implementation of crosscutting concerns, enabling the logic which may otherwise be scattered throughout a system to be encapsulated in a single module. By encapsulating the implementation details of the function or feature they implement, aspects can hide this detail from the rest of the system in much the same way that classes can hide their implementation details by controlling access to their members (Colyer et al., 2005, p.136).
The code for Apoptosis was considered to be a crosscutting concern in this project. Without AOP, virtually identical Apoptosis code would either need to be implemented in multiple objects, scattered throughout the implementation, or a common base class. With AOP, a single Apoptotic aspect can be created to advise each object at the appropriate join points, thus creating a more modularised prototype design and implementation.
Chan and Chieu (2003) propose AOP as a technique to introduce Autonomic self-monitoring and self-managing properties into legacy systems, particularly where the original source code is either not available or is too loosely coupled and spread throughout the application. They state that monitoring application state and initiating appropriate corrective actions when exceptions are raised to be a common method of implementing Autonomic self-Healing behaviour, and argue that the use of AOP allows the monitoring functions to be developed as a separate crosscutting concern and be selectively integrated into the application during development or at runtime. This is achieved by developing an Autonomic Manager which collects and analyses data from the monitored application by means of sensors developed using AOP, and then takes appropriate actions.
The above proposal for application monitoring using AOP by Chan and Chieu has been implemented in a case study by Salehie et al. (2009), whereby a prototype adaptive J2EE e-commerce application was developed, and monitoring sensors added through the use of AOP. Salehie et al. concluded that implementing the adaptive sensors though AOP to be a promising approach to adding Autonomic self-monitoring and self-configuring properties to an application, and that the AOP aspects added little overhead and performed effectively under a high load.
The approach put forward by Chan and Chieu (2003) was adopted and adapted for prototypes and testing in this project. Where they proposed the use of AOP to create monitoring aspects, this project prototyped and tested Apoptotic aspects developed using AOP.
References
Chan, H. & Chieu, T.C., 2003. An approach to monitor application states for self-managing (autonomic) systems. In OOPSLA '03: Companion of the 18th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications., 2003. ACM.
Colyer, A., Clement, A., Harley, G. & Webster, M., 2005. Eclipse AspectJ: Aspect-Oriented Programming with AspectJ and the Eclipse AspectJ Development Tools. Upper Saddle River, New Jersey, USA: Addison-Wesley.
Elrad, T. et al., 2001. Discussing aspects of AOP. Commun. ACM, 44, pp.33-38.
Salehie, M., Li, S. & Tahvildari, L., 2009. Employing aspect composition in adaptive software systems: a case study. In PLATE '09: Proceedings of the 1st workshop on Linking aspect technology and evolution., 2009. ACM.