5 ms·
No. The advice in AspectJ is fully self-contained. You specify -- completely separately in its own place -- what the advice is, and what it is advising. You can
by kqr 5y ago
No. The advice in AspectJ is fully self-contained. You specify -- completely separately in its own place -- what the advice is, and what it is advising. You can advice things that are out of your control.
This is indeed the idea of aspect-oriented programming. I'm not sure where you got a different idea. Could you point me that way?
- taeric 5y agoIn the use of aspectj that I have ever seen, it was always an annotation based thing. I could annotate a method as getting logged to get a trace level log. Yes, the logic of doing the trace was somewhere else, but I couldn't place a trace on any invocation of a named method. Say I wanted to log all calls to (make-hash-table), in elisp, that is an easy advice call. In java, I didn't think that was really doable. That said, thinking on some of the tricks I'm ok with in tests, I guess it has to be possible. Not sure what the code looks like. It is amusing, as even the annotation based stuff I've seen is near universally disliked by engineers with experience from it. Seems a very common foot gun, in practice.