The Artima Developer Community
Sponsored Link

Java Buzz Forum
AOP Differences

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Brian McCallister

Posts: 1282
Nickname: frums
Registered: Sep, 2003

Brian McCallister is JustaProgrammer who thinks too much.
AOP Differences Posted: Mar 2, 2004 11:39 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Brian McCallister.
Original Post: AOP Differences
Feed Title: Waste of Time
Feed URL: http://kasparov.skife.org/blog/index.rss
Feed Description: A simple waste of time and weblog experiment
Latest Java Buzz Posts
Latest Java Buzz Posts by Brian McCallister
Latest Posts From Waste of Time

Advertisement

James suggested I blog on the core difference between DynAOP and AspectWerkz after I quipped in his blog, and I am a sucker for a request, so here goes.

First some definitions, these won't be precise, but they should convey the ideas as they are in use in java open source AOP at the moment: Advice represents code that should modify the behavior or properties of existing code. An interceptor or mixin would be a common example of advice. Pointcuts specify points in code. A typical pointcut might be "any invocation of a method named 'execute' on a class implementing the Action interface." Weaving is a terrible name for the process of combining Poiuntcuts and Advice. Advice is applied to a Pointcut forming an aspectified thingie =)

Aspectwerks and AspectJ do this by bytecode manipulation. They typically modify the bytecode (or sourcecode) of java classes directly so that advice (or hooks for advice) is woven in directly. They may do this as a compile step, or may do this at classload time, the difference is moot. The aspecty stuff is mixed directly into the bytecode.

DynAOP, Nanning, and Rickard's Mysterious Project (reportedly -- no one has actually seen it yet ;-) use a different approach where all aspectified classes are proxied (via a java.reflect.DynamicProxy or CGLIB proxy) and the weaving is done at the proxy, not on the base instance -- the bytecode is unchanged. The drawback is that you have to specifically wrap an instance and talk to the proxy rather than being able to work with whatever is returned by the new magic.

Read: AOP Differences

Topic: J2EE for .NET developers Previous Topic   Next Topic Topic: Curse of Lono Movie Site

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use