AOP Framework

17 views
Skip to first unread message

fmod

unread,
Jun 13, 2010, 6:51:00 PM6/13/10
to Google Web Toolkit
After reading a few posts about AOP and GWT. I decided to give a try
and implement my own AOP framework.

http://code.google.com/p/gwt-tiny-aop

Is still in his early days. But I think is functional enough
(Interception of classes is 90% functional, missing interception of
interfaces).

The code looks like:

{{{
public class MyClass implements Interceptable {
@Intercept(LoggerInterceptor.class)
public int add(int a, int b) {
}
}
}}}

I would be really happy if I can get some feedback on it.

All the best,
-Fran

Carl Pritchett

unread,
Jun 14, 2010, 10:56:12 PM6/14/10
to Google Web Toolkit
IMHO it would be great if you didn't have to add an interface to the
Interceptable classes, but instead created a binding class (something
like a Gin module). Then you could add aspects without changing the
target classes.

Of course easier said than done.

Kevin Qiu

unread,
Jun 15, 2010, 1:13:55 AM6/15/10
to google-we...@googlegroups.com
I was just experimenting and trying to implementing something like this myself. Thanks, this helps. I'll report any issues should I find them.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


fmod

unread,
Jun 15, 2010, 10:44:34 AM6/15/10
to Google Web Toolkit
I did not thought on having a feature like that. Can be great if you
can provide some case study for it.

IMHO doing something similar to gin, should not be that difficult. At
least when it comes to provide a "factory" for the intercepted
classes.

What it struggles me a bit more, is how the methods interception are
defined. Since you don't want to modify the classes, I guess you less
want to annotated their methods. Maybe a good approach is using
Matchers as GIN does.

I believe this feature is more in the scope of GIN. In fact they have
plans to introduce AOP some day.
http://code.google.com/p/google-gin/issues/detail?id=38

I'm developing this 'framework' together with a real application. So,
the features are a bit driven for the needs of my application. But an
integration with GIN is a must someday I will need to face.
Reply all
Reply to author
Forward
0 new messages