Section 7.1. INTRODUCTION


7.1. INTRODUCTION

Aspect-oriented programming (AOP [12]) and adaptive programming (AP [16]) are closely related. Conceptually, AP techniques are a subset of general AOP techniques, but chronologically, AP appeared first. Both AP and AOP deal with separation of concerns, and both aspire to better modularize otherwise crosscutting concerns, but their perspectives are different. AOP enables the programmer to modularize crosscutting concerns. AP enables the programmer to practice concern-shy programming.

7.1.1. Concern-Shy Programming

A program is concern-shy if it abstracts away from some concerns it cuts across. Shy programming builds on the observation that traditional black-box composition is not abstract (disciplined) enough. Conventional black-box composition isolates the implementation from the interface, allowing the implementation to evolve independently of its interface. However, interfaces also evolve [27]. Interfaces become strongly coupled to their clients unless programmers use considerable self-discipline in coding. This discipline of programming abstracted away from certain parts of the interface is referred to as shy programming; shy programming lets the program recover from (or adapt to) interface changes. This principle is similar to the shyness metaphor in the Law of Demeter (LoD [18]; see Section 7.2.3) that argues that since structure evolves over time, it is best to restrict communication to just a subset of the visible objects. The AP principle, contrasted with the principle of black-box abstraction, is summarized as follows:

  • Black-box principle. The representation of an object can be changed without affecting clients.

  • AP principle. The interface of an object can be changed within certain parameters without affecting clients.

7.1.2. Structure-Shy Programming

Current implementations of AP apply concern-shy programming primarily to structure. Structure-shy programming provides a special-purpose embedded language that controls the traversal of objects in complex object-graph structures. Because knowledge of the graph structure is confined to small, specific statements in this special-purpose language, programs that use only these statements are immune to most effects of changing the underlying object relationships (i.e., changes to the class graph). For this reason, we sometimes use structure-shy programming as a synonym for AP. We have created several implementations of this technology. The most recent ones, DJ and DAJ, respectively, use the reflective mechanisms in Java and the aspect-oriented mechanisms in AspectJ to search the graph.

The next section presents shyness in human behavior as a motivating metaphor for adaptive behavior in structure-shy programming. Section 7.3 presents DJ, and Section 7.4 presents DAJ. Related works are described in Section 7.5.



Aspect-Oriented Software Development
Aspect-Oriented Software Development with Use Cases
ISBN: 0321268881
EAN: 2147483647
Year: 2003
Pages: 307

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net