Refactoring and Reflection
Tuesday, 28 October
10:30-12:00
|
|
10:30 - 11:00
|
Language-Independent Aspect-Oriented Programming
Donal Lafferty,
Trinity College Dublin,
Donal.Lafferty@cs.tcd.ie Vinny Cahill,
Trinity College Dublin,
Vinny.Cahill@cs.tcd.ie
The term aspect-oriented programming (AOP) has come to describe
the set of programming mechanisms developed specifically to express
crosscutting concerns. Since crosscutting concerns cannot be properly
modularized within object-oriented programming (OOP), they are
expressed as aspects and are composed, or woven, with traditionally
encapsulated functionality referred to as components.
Many AOP models exist, but their implementations are typically
coupled with a single language. To allow weaving of existing
components with aspects written in the language of choice, AOP
requires a language-independent tool.
This paper presents Weave.NET, a load-time weaver that allows
aspects and components to be written in a variety of languages and
freely intermixed. Weave.NET relies on XML to specify aspect
bindings and ECMA Common Language Infrastructure to avoid coupling
aspects or components with a particular language.
By demonstrating language-independence, Weave.NET provides a
migration path to the AOP paradigm by preserving existing developer
knowledge, tools and software components. The tool's capabilities are
demonstrated with logging aspects written with and applied to Visual
Basic and C# components.
|
11:00 - 11:30
|
Refactoring for Generalization Using Type Constraints
Frank Tip,
IBM T.J. Watson Research Center,
tip@watson.ibm.com Adam Kiezun,
IBM Research OTI Labs,
adam_kiezun@ch.ibm.com Dirk Baeumer,
IBM Research OTI Labs,
dirk_baeumer@ch.ibm.com
Refactoring is the process of applying behavior-preserving
transformations (called "refactorings") in order to improve a
program's design. Associated with a refactoring is a set of
preconditions that must be satisfied to guarantee that program
behavior is preserved, and a set of source code modifications. An
important category of refactorings is concerned with generalization
(e.g., "Extract Interface" for re-routing the access to a class via a
newly created interface, and "Pull Up Members" for moving members
into a superclass). For these refactorings, both the preconditions
and the set of allowable source code modifications depend on
interprocedural relationships between types of variables. We present
an approach in which type constraints are used to verify the
preconditions and to determine the allowable source code
modifications for a number of generalization-related refactorings.
This work is implemented in the standard distribution of Eclipse (see
www.eclipse.org).
|
11:30 - 12:00
|
Partial Behavioral Reflection: Spatial and Temporal Selection of Reification
Eric Tanter,
University of Chile, École des Mines de Nantes/INRIA,
Eric.Tanter@emn.fr Jacques Noyé,
École des Mines de Nantes/INRIA,
Jacques.Noye@emn.fr Denis Caromel,
Université de Nice,
Denis.Caromel@inria.fr Pierre Cointe,
École des Mines de Nantes/INRIA,
Pierre.Cointe@emn.fr
Behavioral reflection is a powerful approach for adapting the
behavior of running applications. In this paper we present and
motivate partial behavioral reflection, an approach to more efficient
and flexible behavioral reflection. We expose the spatial and
temporal dimensions of such reflection. In the context of Java, we
present a reflective architecture offering appropriate interfaces for
static and dynamic configuration of partial behavioral reflection at
various levels, as well as an open reflective extension for Java
implementing this architecture. Reflex is the first extension that
fully supports partial behavioral reflection in a portable manner,
and that seamlessly integrates load-time and runtime behavioral
reflection, along with static optimizations. The paper shows
preliminary benchmarks and examples supporting the approach. The
examples, dealing with the observer pattern and asynchronous
communication via transparent futures, also show the interest of
partial behavioral reflection as a tool for open dynamic
aspect-oriented programming.
|
|