简体   繁体   English

GWT应用程序的客户端AOP选项

[英]Client-side AOP options for GWT apps

It would be nice to be able to define my own method interceptors (advice) and weave them in to my client-side GWT methods, and have GWT automagicallly compile them down into JavaScript with the rest of my app. 能够定义我自己的方法拦截器(通知)并将它们编织到我的客户端GWT方法中会很高兴,并让GWT使用我的应用程序的其余部分自动将它们编译成JavaScript。

I checked out gwt-ent , but it doesn't look like there's been solid development on it since 2009 and there were quite a number of issues. 我查看了gwt-ent ,但看起来自2009年以来它一直没有得到很好的发展,并且存在很多问题。 I've also heard of gwt-tiny-aop but heard it was very limited. 我也听说过gwt-tiny-aop但听说它非常有限。

Do I have any other options here? 我还有其他选择吗? I know AOP requires dynamic bytecode generation, which in turn requires heavy reflection, and that GWT doesn't contain a lot of support (and seems to discourage) the practice of reflection, but I was wondering if there are any stable, well-known AOP libs out there for GWT. 我知道AOP需要动态字节码生成,这反过来需要大量反射,并且GWT不包含大量支持(并且似乎不鼓励)反射的实践,但我想知道是否有任何稳定的,众所周知的AOP在那里寻找GWT。 At least something that I could use for writing AOP Alliance-like interceptors: 至少我可以用来编写类似AOP联盟的拦截器:

public class MyInterceptor implements MethodInterceptor {
    @Override
    public void onIntercept(MethodInvocation mi) {
        // Do some stuff...

        // Let the method execute
        Object results = mi.proceed();

        // Analyze results...

        // Returns results
        return results;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM