Hi,

I think it should be perfectly possible to use the generator for adding
aspects.

You can replace one class with a different implementation, that is what is
done to emulate the JVM classes and that is used all over the place to
implement browser specific code.

But if you are programming against an interface it's always easier to just
create a proxy with a generator that implements your AOP features you want
and then proceed with calling the real implementation class.

David

On Mon, Apr 20, 2009 at 8:43 AM, nicolas de loof
<[email protected]>wrote:

>
>> > I wonder if there is any way to also "pre-process" Java sources, for
>> example
>> > this would enable support for Aspect Oriented Programming or maybe some
>> > DataBinding framework.
>>
>> Depends what you mean by "pre-process"... Generally, generators
>> analyze the class they're called for (for example, looking for
>> specific annotations on methods or on the class itself) and according
>> to this generate a Java class extending the one they've been called
>> for.
>> (is this understandable? is this at least no-so-bad english?)
>
>
>
> In many case the generator will create from MyClassX some MyClassXImpl or
> equivalent that extends the original one, bu not REPLACE it as Java source.
> This is what I mean by "pre-process".
>
> For example, to implement a AOP framework I'd like to instrument all calls
> to some method. For this reason I'd like a generator / pre-processor to
> check the source files and detect the matching pointcuts to add some adived
> code. Many other example can apply, including annotation processing for
> declarative coding (ex : @Property annotation to automagically introduce the
> required PropertyChangeListeners)
>
> I never tried it myself, but I'n not sure a generator can REPLACE the
> original Java Source. I may be wrong but I also thing the generated code is
> only available when using   GWT.create(), making the code less testable
> (with standard junit, not GWTTestCase) and fully GWT-dependenant.
>
> Cheers,
> Nicolas
>
>
>
>
>>
>>
>>
>
> >
>

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

Reply via email to