Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] After Advice and method result

Not sure what is worth mentioning here… but.. random thoughts:

- your app now has a new dependency on the AspectJ runtime (small aspectjrt.jar)
- stack traces from anything that goes bang may have stack frames that exist due to AspectJ weaving, but they should be all that cryptic to work out what they mean
- make sure you are advising just what you need to. Accidentally wildcarding the wrong bit in a pointcut may cause you to weave much more than you expect. Confirm what you are weaving/not-weaving via unit tests or observing -showWeaveInfo output
- the performance impact should be as if you did whatever the aspect is doing ‘by hand’. If it isn’t then maybe we need to revisit what the advice is doing.
- Make sure that unless absolutely necessary you aren’t writing advice that requires a runtime check (since that will impact performance). Anything that does require a runtime check will be mentioned in the -showWeaveInfo output. Writing good quality pointcuts that are well specified will usually not leave runtime checks. If there are runtime checks inserted, could be worth a little performance testing to make sure you are ok with the impact. A runtime check is necessary if you specify something in the pointcut that cannot be statically determined - in that situation the weaver inserts a check that executes at runtime to verify for certain whether the pointcut matches.

cheers
Andy

> On Sep 18, 2015, at 11:23 AM, Rallavagu <rallavagu@xxxxxxxxx> wrote:
> 
> As I got the prototype working as a PoC. Wondering if anybody can help me with what to know before pushing to production in terms of gotchas, potential pitfalls/issues etc.
> 
> Thanks in advance
> 
> On 9/16/15 7:35 AM, Alexander Kriegisch wrote:
>> Yes, it is, so it is good enough for logging, copying etc. But if you want to modify the result before passing it on to the caller you need to use an 'around' advice.
>> 
>> 
>> 
>> _______________________________________________
>> aspectj-users mailing list
>> aspectj-users@xxxxxxxxxxx
>> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top