An AspectJ-enabled Eclipse Runtime Engine - Demonstration at AOSD 04 - Martin Lippert

Similar documents
Introduction to Aspect-Oriented Programming

with Aspect/J 44. Aspect-Oriented Programming Literature [KLM+97] G. Kiczales, J. Lamping, A. Mendhekar, C. Maeda, C.

with Aspect/J 24) Aspect-Oriented Programming Literature [KLM+97] G. Kiczales, J. Lamping, A. Mendhekar, C. Maeda, C.

Evolving mutation from objects to the cloud

Using Aspect-Oriented Programming to extend Protégé. Henrik Eriksson Linköping University

GETTING STARTED WITH ASPECTJ

Aspect Oriented Programming

Context-oriented Programming. Pascal Costanza (Vrije Universiteit Brussel, Belgium) Robert Hirschfeld (Hasso-Plattner-Institut, Potsdam, Germany)

Spring and OSGi. Martin Lippert akquinet agile GmbH Bernd Kolb Gerd Wütherich

A Brief Introduction to Aspect-Oriented Programming" Historical View Of Languages"

Meta-Program and Meta-Programming

Study Goals. Evaluation Criteria. Problems with OO Solution. Design Pattern Implementation in Java and AspectJ

Motivation. Ability is what you're capable of doing. Motivation determines what you do. Attitude determines how well you do it.

A Brief Introduction to Aspect-Oriented Programming. Historical View Of Languages. Procedural language Functional language Object-Oriented language

Towards Regression Test Selection for AspectJ Programs

Take Control with AspectJ

Course 6 7 November Adrian Iftene

Josh. Java. AspectJ weave. 2 AspectJ. Josh Javassist[1] Javassist Java. AspectJ[3, 4] Java. AspectJ. weave. weave. weave. weave. weaver 1.

04/06/2013. Study Goals. Design Patterns in AspectJ. Evaluation Criteria. Problems with OO Solution

Aspect-Oriented Programming and AspectJ

AJDT: Getting started with Aspect-Oriented Programming in Eclipse

Exercise 1: Intro to Java & Eclipse

Mapping Features to Aspects

OSGi on the Server. Martin Lippert (it-agile GmbH)

Aspect-Oriented Programming and Modular Reasoning

Object Oriented Programming. Week 1 Part 3 Writing Java with Eclipse and JUnit

Aspect-Oriented Programming and Modular Reasoning

Improving Incremental Development in AspectJ by Bounding Quantification

Introduction to. Bruno Harbulot. ESNW, the University of Manchester.

Optimized Compilation of Around Advice for Aspect Oriented Programs

JML and Aspects: The Benefits of

AspectScope: An Outline Viewer for AspectJ Programs

Peter Kriens OSGi Evangelist/Director. OSGi R4.3 // Next Release Overview

An Introduction to Aspect-Oriented Programming

Testing Aspect-Oriented Software

Refactoring Aspect Oriented Software

Powered by. These slides are powered by Open Source softwares : Debian GNU Linux Beamer LaTeX mode LaTeX Emacs. Context. Last night OSGi saved my life

Getting the Most from Eclipse

Aspects in AspectJ. October 2013 CSC5021: AspectJ (J P Gibson) 1

The AspectJTM Programming Guide

Shmuel Ur Shady Copty Software and Verification Technologies

Chapitre 6 Programmation orientée aspect (AOP)

Metrics for AOP: Do Aspects Help?

Towards A Metrics Suite for Aspect-Oriented Software

Enterprise Informatization LECTURE

Patterns and Best Practices for Dynamic OSGi Applications

Object Teams Creation Review

Aspect-Oriented Programming

Dynamic Aspects. An AOP Implementation for Squeak. Masterarbeit der Philosophisch-naturwissenschaftlichen Fakultät der Universität Bern.

Interpreter Implementation of Advice Weaving

A Proposal For Classifying Tangled Code

Aspect-Oriented Programming

The Eclipse Rich Ajax Platform

An Aspect-Oriented Approach. Henrique Rebêlo Informatics Center

Improving the efficiency of adaptive middleware based on dynamic AOP

Fun with AspectJ. 1 Getting Started. 2 Defining Pointcuts. Cleveland State University Electrical and Computer Engineering Distributed: April 8, 2008

Aspect-Oriented Programming

1. Introduction. Java. Fall 2009 Instructor: Dr. Masoud Yaghini

OSGi & Spring combined

Language support for AOP

Troubleshooting Serverless Functions

Information systems modeling. Tomasz Kubik

Equinox Framework: How to get Hooked

TRAP/J v2.1: An improvement for Transparent Adaptation

A Unit Testing Framework for Aspects without Weaving

mismatch between what is maybe possible today and what is going on in many of today's IDEs.

Programming AspectJ with Eclipse and AJDT, By Example. Chien-Tsun Chen Sep. 21, 2003

Eclipse + Html: A Journey

The Eclipse Rich Client Platform

Rich Client GUI's with RCP & RAP

Table of Contents. 1 Introduction Downloads Eclipse SDK Installation Eclipse Workspace Eclipse Preferences...

10 ways to reduce your tax bill. Amit Nithianandan Senior Search Engineer Zvents Inc.

InsECTJ: A Generic Instrumentation Framework for Collecting Dynamic Information within Eclipse

SpringSource Tool Suites M3

Chapter 1 Introduction to Computers, Programs, and Java

DISCUSSING ASPECTS OF AOP

Bugdel: An Aspect-Oriented Debugging System

Program Transformation with Reflective and Aspect-Oriented Programming

OBJECT ORIENTED PROGRAMMING

INFO Object-Oriented Programming

Dynamic Aspect Composition using Logic Metaprogramming

This tutorial will take you through simple and practical approaches while learning AOP framework provided by Spring.

Introduction to Eclipse

02/03/15. Compile, execute, debugging THE ECLIPSE PLATFORM. Blanks'distribu.on' Ques+ons'with'no'answer' 10" 9" 8" No."of"students"vs."no.

Create your own Carbon Component. Sameera Jayasoma Technical Lead and Product Manager of WSO2 Carbon

Chapter 1 Introduction to Java

Introduction to Eclipse

Object Teams Release Review. Planned Review Date: July 7, 2010 Communcation Channel: Submitted by: Stephan Herrmann

Lecture 16 & 17. Crosscutting Concerns N-dimensional separation of concerns, AspectJ, Mixin, Concern Graph, etc.

Beyond Aspect-Oriented Programming: Toward Naturalistic Programming

TestingofScout Application. Ludwigsburg,

DAJ User's Guide. by John J. Sung. Introduction. Installation. Requirements. Downloading and unpacking DAJ

Getting Started with Eclipse/Java

JAVA. Aspects (AOP) AspectJ

Example: Fibonacci Numbers

CS 520 Theory and Practice of Software Engineering Fall 2018

Chapter 32. Aspect-Oriented Software Development (AOSD) Ian Sommerville 2006 Software Engineering. Chapter 32 Slide 1

II. Compiling and launching from Command-Line, IDE A simple JAVA program

Using Aspect-Oriented Programming to Streamline Mobile Application Development

The New Generation of the Eclipse Platform. Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék

Transcription:

An AspectJ-enabled Eclipse Runtime Engine - Demonstration at AOSD 04 - Martin Lippert lippert@acm.org www.martinlippert.com

Motivation Use Eclipse 3.0 RCP to develop enterprise applications Use AspectJ to improve modularity What happens if we want to use both techniques to develop applications? Especially to modularize cross-plugin pointcuts

Example PLUGIN PLUGIN B PLUGIN A class Line { private Point p1, p2; Point getp1() { return p1; Point getp2() { return p2; void setp1(point p1) { this.p1 = p1; void setp2(point p2) { this.p2 = p2; class Point { private int x = 0, y = 0; int getx() { return x; int gety() { return y; PLUGIN C aspect DisplayUpdating { pointcut move(figureelement figelt): target(figelt) && (call(void FigureElement.moveBy(int, int) call(void Line.setP1(Point)) call(void Line.setP2(Point)) call(void Point.setX(int)) call(void Point.setY(int))); after(figureelement fe) returning: move(fe) { Display.update(fe); void setx(int x) { this.x = x; void sety(int y) { this.y = y; Example taken from the AspectJ Tutorial

Design Alternatives Recompile the complete system with AspectJ (ajc) to weave an aspect into the whole system Weave the complete system once at startup-time using the -injar option of AspectJ Weave (and re-weave) classes when necessary using load-time bytecode weaving I chose this alternative in order to be as compatible as possible with the Eclipse ideas

Solution: A load-time weaving runtime The basic idea: Let the Eclipse runtime weave aspects into plugins at load-time

Implementation - load-time weaving - aspect1.aj aspect2.aj classa.java ajc (compile & weave) woven bytecode Java VM runs the system classb.java classc.java compile time weaving aspect1.aj aspect2.aj classa.java classb.java ajc (compile only) javac compiled bytecode compiled bytecode Java VM with Eclipse runtime weaves each single class at load-time classc.java load time weaving

Implementation - aspect contribution - Load-time weaving within the Eclipse runtime: Weaving runtime needs to know all aspects that should be woven into Solution: Weaver plugin provides an extension point for aspects Plugins can contribute aspects via extensions <extension id="monitorruntime" name="monitorruntime" point="org.aspectj.weavingruntime.aspects"> <aspect class="com.ibm.eclipse.monitor.aspect.monitoraspect"> </aspect> </extension>

Implementation - weaving inside the runtime - Problem: load-time weaving has to happen at class-loading time Solution: inject load-time bytecode modification into the Eclipse runtime AspectJ 1.1 bytecode weaving implementation on a per class base Eclipse Platform... runtime

Implementation - reusing weaver API from AspectJ - Bytecode weaving plugin uses the weaver API from the AspectJ 1.1 implementation No additional effort to implement aspect weaving All improvements of AspectJ 1.2 can be re-used directly Complete AspectJ language can be used

Hooking into the runtime Eclipse 2.1.x: Modification of original runtime plugins needed But still a fully compatible runtime Eclipse 3.0: New OSGi-based runtime is a lot more flexible for this kind of extensions Load-time bytecode modification can be implemented in separate plugin (via a specialized OSGi framework adaptor) DynamicImport-Feature can be used to handle additional dependencies between plugins

Demo Using the Eclipse IDE 3.0 itself as the application enhanced via aspects With special thanks to Chris Laffra for the Monitor plugin

More Use Cases - within and beyond the Eclipse RCP - Analyzing - e.g.: Find out where objects of a specific type are created Find out where they are created depending on a specific control flow Enhancing - e.g.: Do something every time a plugin is started, maybe depending on the control flow Modifying external libraries - e.g.: Replace calls to the system class loader with calls to the class loader of the plugin...

Status of Work Implementation available for Eclipse 2.1.2 3.0M4 (old runtime) 3.0M8 (new OSGi-based runtime) Features Open Source Load-time weaving for AspectJ 1.1 (and upcoming 1.2) Caching for woven classes (to improve startup time) Availability More information: www.martinlippert.com If you are interested, please contact me: lippert@acm.org

The Next Steps Improvements Performance Footprint Code refactorings Dynamic Plugins New runtime features install/update/uninstall of plugins at runtime What happens to aspects being installed/updated/uninstalled? Solution: run-time like weaving for AspectJ Debugging debugging within the PDE

Thank you for your attention!!! - Questions highly welcome - Special thanks to the Eclipse Runtime Team and the AspectJ- Team for their help and assistance implementing the prototype Martin Lippert lippert@acm.org www.martinlippert.com