Here's an easy one, surely someone knows this off the top of their head...
When you write 'around' advice in AspectJ, do you have to call proceed? Lets say you wanted to make a method do something COMPLETELY different? Can you leave 'proceed' out or will it generate an error (forcing you to call proceed but ignore the results)?
can you do something like this:
String around() : generateCommand() {
//never call proceed
return getCommanMyOwnWayWithoutAccessingDatabase();
}
or do you HAVE TO do it like this:
String around() : generateCommand() {
String commandInvolvingInvalidDatabaseCall = proceed();
//completely ignore results from proceed
return getCommanMyOwnWayWithoutAccessingDatabase();
}
Call proceed() or proceed(..) only if you want to call the functionality of your adviced method. So in your case if you want to do something completely different, don't call it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With