From: wisberg Date: Sat, 28 Aug 2004 22:16:10 +0000 (+0000) Subject: fix bug 59203 - dynamic AOP X-Git-Tag: V1_2_1~75 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8891fe602305f157059415160335682d1249bd53;p=aspectj.git fix bug 59203 - dynamic AOP --- diff --git a/docs/faq/faq.xml b/docs/faq/faq.xml index 4df03fe0e..f178f09a0 100644 --- a/docs/faq/faq.xml +++ b/docs/faq/faq.xml @@ -870,6 +870,48 @@ aspect. + + + How does AspectJ compare with more dynamic AOP? + + + + + Some AOP techniques are presented as "dynamic" because the weaving + occurs when classes are loaded, because aspects can be configured + in a separate XML file before launch, or because some advice + depends on runtime reflection. They are said to be more flexible + than AspectJ. + + + This is a misconception. First, the AspectJ 1.1 weaver has always + supported weaving at compile-time or class-load-time. Weaving at + compile-time reduces application launch and running time, and it helps + IDE's offer support for tracking down weaving errors and understanding + the impact of aspects on a system. + On the other hand, weaving at load-time simplifies build and deployment. + Before AspectJ 1.2, the user had to write a class loader that used the + weaver API to weave at load time; since 1.2, AspectJ come with a + command-line launcher to support weaving at class-load-time without + any other changes to a build configuration. + + + Second, AspectJ programs, like Java programs generally, can be + written to support any level of XML configuration or to depend on + runtime reflection. There are some benefits to using AspectJ; + e.g., the proceed() form within around advice simplifies a lot of + the work that otherwise would go into writing a generalized + interceptor, without introducing many of the runtime errors that can + result from interceptors. + For AspectJ examples of configurable or reflection-dependent programs, + see the sample code linked off the AspectJ documentation page + or the examples discussed on the mailing list, e.g., + + Incremental and runtime weaving support?. + + + - - - - - - - - - - - - - +