An Aspect-Oriented Approach to Dynamic AdaptationWhat is Dynamic Adaptation?Dynamic AdaptationExample of tangled codeAspectsCode in aspectJHow does AOP apply to Dynamic Adaptation?AOP applied to Dynamic AdaptationConclusionsReferencesAcknowledgementsAn Aspect-Oriented Approach to Dynamic AdaptationAugust 8, 2002Presented by: Sherri GoingsAdvisors: Dr. Dillon, Dr. Cheng, Dr. StirewaltSENS Lab www.cse.msu.edu/sensWhat is Dynamic Adaptation?•Traditional programs –defined at compile time, –code cannot be changed at run-time•Dynamically adaptive programs –Code may change at run-time–Changes are triggered by environmental conditionsDynamic Adaptation•Concerns that warrant dynamic adaptation include–Quality of Service (QoS)–Security–Error Logging•Such concerns are cross-cutting in nature–Code is scattered throughout program–Difficult to read, understand, debug, and modifyExample of tangled code•Code in red pertains to Error Logging–Spread throughout the programAspects•Mechanisms used to collect and extract scattered but related code•Aspect can be woven into existing code at compile time–Code in Aspect is automatically scattered•This enables extension of existing programs functionality to handle a new concern–No need to modify original codeCode in aspectJ•Code for Error Logging has been pulled out into its own classHow does AOP apply to Dynamic Adaptation?•Start with a traditional program –Core program•Use aspects to–Make program ready for adaptation•Adapt-ready program–Define the dynamic adaptations•E.g. add security, improve QoS •At run-time the program adapts to changes in environmental conditionsAOP applied to Dynamic AdaptationConclusions•Using aspects to achieve dynamic-adaptation allows–Separation of application code from adaptation code–Run-time changes in functionality of original program without modifying core programReferences•Tzilla Elrad, Robert E. Filman, and Atef Bader. Aspect-oriented programming. In Communications of the ACM, October 2001-Volume 44, Number 10, pp29-32.•Gregor Kiczales, Erik Hilsdale, Jim Hugunin, Mik Kersten, Jeffrey Palm, and William G. Griswold. Getting started with aspectJ. In Communications of the ACM, October 2001-Volume 44, Number 10, pp59-65.•Z. Yang, B.H.C. Cheng, R.E.K. Stirewalt, J. Sowell, S.M. Sadjadi, and P.K. McKinley. An Aspect-Oriented Approach to Dynamic Adaptation. SENS lab, CSE dept., MSU•http://aspectj.org/Acknowledgements•Special thanks to–Masoud Sadjadi–Zhenxiao Yang–Jesse Sowell•Supported by–MSU College of Engineering–National Science Foundation Grant•For further info please visit
View Full Document