The Artima Developer Community
Sponsored Link

Java Buzz Forum
DynAOP Impressions

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.
DynAOP Impressions Posted: Feb 14, 2004 7:37 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Brian McCallister.
Original Post: DynAOP Impressions
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

I have been playing with dynaop by Bob Lee (crazybob) for a bit now and am quite impressed. It pretty much does what my goals with intercepts were, plus a bit more (mixin support), and with a friendlier client API. Bob knows how to write a clean client API, that is for sure, and the BeanShell configuration is brilliant (though I have been using the Java config API instead -- which is also quite clean!).

Its interesting to see how he gets around this in mixins. DynAOP's solution is to use a type 1 style ioc container setup where the proxy can be provided to the mixin. It certainly works fine (is pragmatic ;-) but this support allows for more idiomatic Java. The way I did it in YAIL was to intercept all internal calls against anything not explicity declared in the mixin, or classes it extends, and return the call against the proxy from the interceptor, instead of against the mixin. This worked fairly nicely, and allowed for partial-class type things (implement an interface and only implement parts while trusting that the rest of the mixed in stuff will fill out the rest).

The proxy system is great (Bob certainly gets clean design) -- the cglib proxy for classes acts just like the interface proxy version, so the majority of the tool doesn't care if it is an interface proxy of cglib proxy.

It is just a hair slower than unbaked Yail interception in my tests, which is pretty impressive as Yail blows the other AOP's away even without baking in yet. I have figured some ways to speed up the unbaked Yail interception but haven't yet implemented them -- and to be honest, am considering not bothering to now! DynAOP gives me everything I was looking for when I started writing YAIL. It has some drawbacks though, which make me sit on the fence about dropping YAIL. First, it is built against CGLIB 1.0 and doesn't run against CGLIB 2.0 (which is due for release any-day-now). This is a significant drawback, but can probably be overcome with a couple patches. Second is the LGPL license, which can be inconvenient in infrastructure type tools in Java (which this definately is). Finally, there is no mechanism for proxying specific instances of a class instead of interface, but I don't think it would be difficult to add in (particularly if the switch to CGLIB 2 is being made).

All said -- the license thing may knock it out as my preferred tool as I do too much with BSD and Apache licensed projects, and I really want a good interceptor tool against them. Nanning is quite nice, but is pure Java DynamicProxy based with no support for class extension directly. From a technical standpoint, I would probably switch right over as modifying it for cglib2 and adding proxies to existing instances shouldn't be hard if the internals are as clean as the client API's!

Read: DynAOP Impressions

Topic: Stunning figures! Previous Topic   Next Topic Topic: Applying Enterprise JavaBean quiz

Sponsored Links



Google
  Web Artima.com   

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