Val's Blog
Lots of stuff for Web 2.0 freaks and Java addicts
Feeds RSS | Atom | RDF
 
 
Albert Einstein: "Intellectuals solve problems: geniuses prevent them."
[ Login ]

July 2004
SunMonTueWedThuFriSat
     1  2  3 
 4  5  6  7  8  9  10 
 11  12  13  14  15  16  17 
 18  19  20  21  22  23  24 
 25  26  27  28  29  30  31 
Jun  |  Today  |  Aug
XML Feeds   Subscribe with Bloglines

Javaranch Sheriff   My LinkedIn Profile
Drop me a line or two   Bloglines Blogroll
JavaRSS   Referers
How cool are you?   My Reviews

Next trips...
SpringOne 2008 (Jun 11-12, 08)
Ajax Exp. 2008 (Sep 29-Oct 1, 08)
Top 10 entries (#hits)
(As of Nov 30, 2007)


Top 10 entries (#hits/day)
Come Back (5.032)
(As of Nov 30, 2007)
Recent Blog Entries
Recent Blog Comments
Re: Review of "Marketing Management 12th"
i know marketing management by kotler is good book but the problem is that the management part of this book is totally missing as fare as i know managemet is complete different subject and it should not be mixed i am student of MBA i was looking at ass...

Re: Review of "Pro Spring"
Using simple POJOs + factories without Spring for "echo" and "counter" would be a lot more easier. No need to write those XML files... So, in this case using Spring makes me write a lot more code... (OK, you can generate everything with the help of And...

pls urgent
Hi I am trying to generate the word doc but i m not understanding wats happening any one pls figure it out /* * WordAPI.java * * Created on May 30, 2006, 10:50 AM * * To change this template, choose Tools | Template Manager * and open the te...
Archives (# entries)
Links
Other Blogs
Other Blogs

Reviewing
Reading
Locations of visitors to this page
What they once said...
 

Yesterday, I read Devx's article on Java Dynamic Proxies and how they can help you achieve AOP. This morning Sam Newman is commenting that Dynamic Proxies and AOP are two completely different things.

I partly agree with Sam's comments. Although, I would like to elaborate a little bit on why Devx's article is not that far off the truth. The author might not have found the proper words for communicating her thoughts, but this is another debate.

In order to understand why Sam's statements are neither completely true nor wrong, it helps to know what the fundamentals of AOP are. Basically, the AOP paradigm mandates the following three main concepts:

  • a join point model that provides support for explicitely identifying hooks in the system where aspectual behavior can be added
  • a means for modifying the static structure of existing system artifacts
  • a mechanism for encapsulating crosscutting concerns within first-class constructs

Any respectable AOP framework should provide concrete means for implementing those concepts. For instance, AspectJ realizes those concepts with, respectively, the pointcut/advice constructs, the introduction mechanism and the aspect construct. AspectWerkz provides a 100% Java AOP solution with normal methods (+ attributes @Before, @Around, @After, @Expression), static inner classes (+ attribute @Introduce) and normal Java field (+ attribute @Implements) wrapped within normal Java classes (+ attribute @Aspect). I won't go into each and every framework available, but this demonstrates that they all have their own way of implementing AOP concepts. JBoss uses dynamic proxies as interceptors for hooking up aspectual behavior to existing code. EJBs use dynamic proxies for hiding the communication layer complexity from the application layer. In clear, dynamic proxies are clearly one solution (among many) for separating (some!) crosscutting concerns from the business code and this is where I agree with Sam in that he says that dynamic proxies are a means to an end.

The fact that AspectJ doesn't use dynamic proxies doesn't mean that dynamic proxies have nothing to do with AOP as implied by Sam. AspectJ is just an AOP implementation that happens to be somehow one of the most famous and most supported implementation out there. Too many people think that the equation "AspectJ = AOP" yields true, which is just plain wrong since they are conceptually at two different levels. It is my opinion indeed that the AOP paradigm somehow "suffers" from AspectJ's view of AOP and that when people talk of aspects they somehow unconsciously think of it in the AspectJ sense, which might not be AspectJ's fault of course but more a problem of how it has been and is being marketed.

Moreover, the fact that dynamic proxies have been around before the AOP paradigm itself doesn't mean that dynamic proxies have nothing to do with AOP either. Similarly, the wheel has not been invented for cars exclusively and the notion of a wheel has nothing to do with the notion of a car. Car constructors have just identified the wheel as an ideal existing solution element for moving cars around. Again, dynamic proxies are one solution that existed at the time AOP people needed to implement certain AOP concepts and that's all!

To sum up, please do not mix up things whose roots and foundations lie at different levels. In clear, compare what is comparable.

I finally got to read something official regarding the standpoint of Microsoft towards AOP via Dion Almaer's blog this morning. Thank you Dion. Gates' stance somehow clears things up and kind of provides answers to my previous questioning and incertitude. Thanks Bill Let's wait and see what unfolds...

 
About this Blog