To: wand@ccs.neu.edu Subject: Re: DJ as AOP Hi Mitch: my comments below. I like your analysis. Similar to Doug's. -- Karl >From wand@ccs.neu.edu Wed Oct 10 08:27:08 2001 >From: Mitchell Wand >MIME-Version: 1.0 >Date: Wed, 10 Oct 2001 08:26:30 -0400 >To: Karl Lieberherr >CC: Doug Orleans , Johan Ovlinger >Subject: DJ as AOP > >Some text for our paper might go something like this: > > >We may regard DJ as a variety of AOP. To understand how DJ fits into >AOP, we first consider conventional programming. In conventional >programming, a program consists of a set of procedures that are >invoked \emph{procedurally}, that is, from other procedures. Ordinary OOP >fits into this model, since methods are a kind of procedure. > >The key innovation of AOP, as embodied in systems like AspectJ, is a >mechanism to allow procedures to be invoked \emph{declaratively}. >Such a mechanism identifies a set of events during the computation at >which procedures may be invoked (the join points), a declarative >language for specifying a set of such events (the "point cut >descriptors"), and a means of associating procedures with such designators (not descriptors) >declaratively-specified sets. This is a dynamic join point model. > >In DJ we have: > >o the computation is the traversal. In DJ, this is also specified > declaratively. In DJ, the traversal specification plays a dual role: defines a traversal program defines a set of join points relative to the traversal program. While in AspectJ we focus on join points in an existing program, with DJ we first define a program and a set of join points of interest and then use advice on that set of join points. > >o the join points are the passage of the traversal through a node in a node or edge > the in the object graph. > >o the point cut specifiers are: the beginning and end of the > traversal, and the passage of the traversal through a node of a node or edge > specified type. > >o procedures are associated with a point cut by making them into > methods of a visitor. The name of the visitor and the type of its > argument (eg "before...") serve as the point cut descriptor > language. > >Because the computation is specified declaratively, the mechanism for >invoking the visitors can be hidden inside the implementation of the >traversal. This allows the separation of the traversal behavior from >the aspect or visitor behavior. > In DJ as in AspectJ we can query the current join point object. In DJ this allows us to easily access objects that are on the "traversal stack". -- Karl > >[Probably not for the paper, but worth noting: The Observer or >Model-View-Controller pattern also fits into this model of AOP. The >join points are the execution of a notify in the Model. In this >pattern there is only one pointcut, which is matched by all the join >points. A procedure associates itself with the pointcut by >registering with the notifier.] > >I'll probably be integrating this text, or something like it, into the >paper this afternoon. > >What do you think? > >--Mitch >