Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Re: [NEWSDELIVER] Could "declare warning" output method signature?




James,

If you are talking about entry/exit trace (which can be easily refactored
as an aspects) as opposed to debug trace (which tends to occur at arbitrary
points in the code not coincident with a well define set of join points and
is hence much more difficult to refactor) and the distribution appears to
be random then there is little point in trying to reproduce the "policy"
using an aspect. The resulting pointcuts will be "fragile" to changes in
the base code i.e. when someone adds a new method or changes the signature
to an existing one it won't be traced. Much better to express the actual
policy you want i.e. "all public methods excluding toString()" and capture
that as an aspect. If this results in too much output or an unacceptable
performance overhead it is a simple task to refine the aspect and exclude
those methods that are not needed.

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/

James Gan <gan-zhi@xxxxxxxxxxxxxx> on 18/04/2005 09:31:45

To:
cc:
Subject:    [NEWSDELIVER] Could "declare warning" output method signature?



Hi, all

I'm refactoring a large project with AOP. Trace code is distributed almost
pure
random. I can't summarize a simple and clean policy. So I think if "declare

warning" can output method signature, I can easily write a pointcut which
can
cover accurately the same set of method with manual coded trace statement.

Please give me some advices about what to do it.

Thx!
James Gan






Back to the top