开发者

Active Flash/Flex/ActionScript 3 AOP project?

开发者 https://www.devze.com 2022-12-21 14:02 出处:网络
I\'ve seen the Loom project, but are there any alternatives that are more mature (and actively 开发者_Go百科developed)?I am looking for something that would allow load-time weaving of pointcuts into e

I've seen the Loom project, but are there any alternatives that are more mature (and actively 开发者_Go百科developed)? I am looking for something that would allow load-time weaving of pointcuts into existing binary code at runtime with the AVM2 runtime.

Has any work been done in this area?


Check out:
http://code.google.com/p/floxy/
http://code.google.com/p/flemit/


I know I'm a little late to the party here, but I've just put together a really simple AOP project for integration with Parsley.

It allows you to assign metatags to interceptors, like so:

    <parsley:ContextBuilder>
        <parsley:FlexConfig type="{ParsleyConfig}" />
        <tag:AspectSupport>
            <tag:MetatagInterceptorDefinition metatag="Log" interceptor="{new TracingInterceptor()}" />
        </tag:AspectSupport>            
    </parsley:ContextBuilder>

Then, any classes in the Parsley context that are annotated with Log get that method proxied:

    [Log]
    public function add(a:int,b:int):int
    {
        return a + b;
    }

The project is here and a blog post explaining in more detail is here


As the author of flemit / floxy (though both were only created for asmock), I would recommend looking into AS3Commons Bytecode as it is under active development (flemit/floxy are not).

AS3Commons Bytecode is actually based on the Loom project and has been extended to use a much cleaner API than flemit was ever intended to have.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号