Adaptation of legacy codes to context-aware composition using aspect-oriented programming

  • Authors:
  • Antonina Danylenko;Welf Löwe

  • Affiliations:
  • Software Technology Group, Linnaeus University, Växjö, Sweden;Software Technology Group, Linnaeus University, Växjö, Sweden

  • Venue:
  • SC'12 Proceedings of the 11th international conference on Software Composition
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

The context-aware composition approach (CAC) has shown to improve the performance of object-oriented applications on modern multi-core hardware by selecting between different (sequential and parallel) component variants in different (call and hardware) contexts. However, introducing CAC in legacy applications can be time-consuming and requires quite some effort for changing and adapting the existing code. We observe that CAC-concerns, like offline component variant profiling and runtime selection of the champion variant, can be separated from the legacy application code. We suggest separating and reusing these CAC concerns when introducing CAC to different legacy applications. For automating this process, we propose an approach based on Aspect-Oriented Programming (AOP) and Reflective Programming. It shows that manual adaptation to CAC requires more programming than the AOP-based approach; almost three times in our experiments. Moreover, the AOP-based approach speeds up the execution time of the legacy code, in our experiments by factors of up to 2.3 and 3.4 on multi-core machines with two and eight cores, respectively. The AOP based approach only introduces a small runtime overhead compared to the manually optimized CAC approach. For different problems, this overhead is about 2-9% of the manual adaptation approach. These results suggest that AOP-based adaptation can effectively adapt legacy applications to CAC which makes them running efficiently even on multi-core machines.