Hello Jarrod

I have implemented an IOC and AOP framework for GWT - rocket-gwt -
everything is defined in a Spring like xml file and the factory realised at
runtime via a generator.

I am however after looking back not convinced of the need for AOP in a GWT
environment because of the extra crap that is needed to support the idiom.

Basically the following operations need to be supported to emulate the AOP
alliance interfaces.

   - Unwrapping parameters into an array.
   - Invoking interceptors passing the array of parameters.
   - At the end of the interceptor chain one needs an adapter to invoke the
   original method after re-wrapping the parameters.

Attempting to emulate the AOP alliance interfaces ( my versions are almost
identical copy with minor diferences - eg I pass the method name instead of
java.lang.ref.Method instances) adds a lot of bloat because of the need to
generate classes to support for each and every targetted class. Any solution
that attempts to emulate reflection for the GWT runtime will result in the
same need for generated types. If you want look at my tests after turning
the compiler option to keep generated classes and you can take a look at
what im describing above.

Implementating a Spring like IOC container with support for all the basic
interfaces (InitializingBean, FactoryBean etc ) with support for all the
different lifecycle interfaces also requires a lot of generated classes.
Again take a look at the generated classes for further details.

To reduce the "noise" one needs to chop out or simplify features
considerably. But then again who wants to write an interceptor that doesnot
have access to the target method arguments, types or name ? Im not convinced
of the value in such a case.

hth

On Mon, Feb 9, 2009 at 6:11 AM, Arthur Kalmenson <arthur.k...@gmail.com>wrote:

>
> Hello Jarrod,
>
> If you're looking for a Dependency Injection framework for the client
> side, look no further then Google GIN:
> http://code.google.com/p/google-gin/. It's essentially a Guice
> implementation on the client side. Method interception, i.e. AOP, is
> planned: http://code.google.com/p/google-gin/wiki/GuiceCompatibility.
>
> --
> Arthur Kalmenson
>
>
>
> On Sun, Feb 8, 2009 at 1:27 PM, jarrod <jarrod.carl...@gmail.com> wrote:
> >
> > I'm a huge fan of GWT, but I'm also a big fan of development
> > methodologies, like Inversion of Control and Aspect-Oriented
> > Programming.
> >
> > IoC and AOP are two concepts I've struggled to work into the GWT
> > framework since day one, with AOP being a bit more difficult to
> > achieve than IoC, in my opinion.
> >
> > I recently came across the Dojo Toolkit, which includes, among other
> > things, a facility for advising your code, AOP style:
> > http://svn.dojotoolkit.org/src/tags/release-1.2.3/dojox/lang/aspect.js
> >
> > After digging into it, it appears to take advantage of the dynamic
> > nature of the JavaScript language, swapping out implementations of
> > advised methods at run time with wrapper functions.
> >
> > All-in-all, I think this is a rather brilliant approach, and it's
> > something I'd love to see supported in GWT. The only problem I see is
> > how to go about crossing that dynamic bridge that, at first glance,
> > appears to be the kind of thing Java and GWT might not work well
> > with.
> >
> > Of course, deferring to native code implementation is an option, but
> > that seems to defeat the purpose of the compiler's advantages. Any
> > suggestions on this?
> > >
> >
>
> >
>


-- 
mP

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to