[Prévia] [Próxima] [Prévia por assunto] [Próxima por assunto]
[Índice cronológico] [Índice de assunto]

load-time/run-time weaving e dynamic AOP



Olá professor,

Acho que me enganei na aula de ontem quando conversamos sobre as
possibilidades de weaving no Aspectj5, pois, atualmente ele dá suporte
apenas a compile-time weaving, post-compile weaving e load-time weaving
(LTW), particularmente melhorando a forma de fazer o último caso (agora
está equivalente ao AspectWerks):

"You may also hear the term "run-time weaving". We define this as the
weaving of classes that have already been defined to the JVM (without
reloading those classes). AspectJ 5 does not provide explicit support for
run-time weaving although simple coding patterns can support dynamically
enabling and disabling advice in aspects".
(http://www.eclipse.org/aspectj/doc/released/devguide/ltw.html#ltw-introduction)


Como vi no slide AOP estática x dinâmica, minha intenção era comentar que
nem sempre é correto falar que AspectJ não é dynamic AOP. Na minha opnião
acho que é mais apropriado falar em suporte explícito a "hot deployment"
ou não:

"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 ..."
(http://www.eclipse.org/aspectj/doc/released/faq.php#q:loadtimeWeaving)

"The term "dynamic AOP" is sometimes used to describe hot deployment, but
note that this term can be misleading since all of the AOP tools support
dynamic join point models.
(http://www-128.ibm.com/developerworks/library/j-aopwork2/)"

Este último link faz uma comparação entre AspectJ, AspectWerks, Spring AOP
e JBoss AOP. E resumindo, apenas AspectJ não dá suporte a hot-deployment
atualmente. Apesar que ele cita os tradeoffs de desempenho para habilitar
isso e as limitações do Spring e JBoss AOP, já que são baseados em
interceptadores/proxies.

Bem, para quem trabalha com AspectJ o jeito é esperar o pessoal tb migrar
essa funcionalidade já presente no AspectWerks.

Peço desculpas pelo email enorme, mas a intenção era me corrigir.

Abraços.

Raoni Kulesza.