|Ph.D Thesis||Department of Computer Science|
|Supervisor:||Assoc. Prof. Gil Joseph|
|Full Thesis text|
This work presents a suite of related programming constructs and technologies aimed at integrating aspect-oriented programming (AOP) in the middleware frameworks used for enterprise application development. These constructs include shakeins (and the AspectJ2EE language design based on it), JTL (the Java Tools Language), factories, and object evolution.
Shakeins are a novel construct which generates new classes from existing ones in an automatic manner: Given a class, a shakein generates a new class which has the same type, but with different data and code implementation. This thesis argues that shakeins are restricted, yet less chaotic, aspects. Shakeins are well suited for the introduction of AOP into existing middleware applications.
To demonstrate the applicability of shakeins to middleware frameworks, we introduce the AspectJ2EE language which, using shakeins and a new deploy-time weaving mechanism, brings the blessings of AOP to enterprise Java (J2EE). A unique advantage of AspectJ2EE, which is less general (and hence less complicated) than AspectJ, is that it can be smoothly integrated into J2EE implementations.
Any AOP solution must provide developers with a mechanism for specifying a set of joinpoints, i.e., program locations to be modified by relevant aspects. Such "pointcut" specifications are commonly expressed using queries written in a dedicated, declarative language. We present JTL as a new query language. JTL provides a powerful query-by-example mechanism, minimizing the abstraction gap between queries and the program elements they match. We further show how JTL can be extended to support program transformations.
Factories are a new mechanism for controlling object instantiation, overcoming anomalies that can be found in the construction mechanisms of OOP languages. Factories (not to be confused with the Factory Method or Abstract Factory patterns) provide classes with complete control over their instantiation mechanism. In particular, classes can enforce the application of shakeins to all instances, without disturbing existing client code.
Finally, we allow shakeins to behave as dynamic aspects, i.e., aspects that can be applied to an object or removed from it at runtime. Because applying a shakein to a class generates a new class, we find that this requires object reclassification. Reclassification using shakeins is part of a more general concept, called Object Evolution. Object evolution is a restriction of general reclassification by which changes are monotonic: an object may gain, but never lose, externally-visible properties. We show many applications of monotonic evolution in practical systems. The monotonicity property makes it easier to maintain static type safety.