Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Re: WebLogic Aspect Framework


I took a look through the WebLogic Aspect framework and I  like the direction this is going in. Ron Bodkin and I have started work on a similar library as part of the preparations for the forthcoming "Enterprise Aspect-Oriented Programming with AspectJ" tutorial (http://oopsla.acm.org/oopsla2003/files/tut-39.html), one of the key differences being that we expose more context in the pointcut definitions for use by advice.

Using servlets as an example. we define

public pointcut httpServletRequest(HttpServlet servlet, HttpServletRequest request, HttpServletResponse response) :
  (execution(public void HttpServlet.doPost(HttpServletRequest,HttpServletResponse ) ||
   execution(public void HttpServlet.doGet(HttpServletRequest,HttpServletResponse))  &&
  args(request, response) &&
   this(servlet);

It's interesting to note how the properties of J2EE (and any framework that uses inversion of control) make it possible to define very robust pointcuts by standardizing interfaces. It also brings additional challenges (such as adding advice on lifecycle events like init() that may or may not be overridden in components). We go into some of this in the tutorial (shameless plug ;) ).

I think it would be great for the aspectj community to collaborate on defining a library of pointcuts for J2EE - which could be done as part of the new AspectJ samples initiative initially perhaps.

Ideally the pointcuts would be declared in interfaces, which allows different application servers to implement them using app-server specific generated method names etc. where needed, but still allows users to program to a common interface. To use interfaces in this way requires a little work in the AspectJ compiler, which I will describe in a separate post to aspectj-dev for the interested. It's exciting to see aspect libraries becoming a reality with the new support that was released in AspectJ 1.1.

-- Adrian.
Adrian_Colyer@xxxxxxxxxx

gregorkiczales wrote:
>See the weblogic aspects mailing list for more info.  
>(http://groups.yahoo.com/group/weblogic-aspects/)
>
Here is some additional information:
Short announcement on my blog:  http://freeroller.net/page/cbeust/20030722
TheServerSide thread:  
http://www.theserverside.com/home/thread.jsp?thread_id=20514
--
Cédric
http://beust.com/weblog


Back to the top