Archive for the ‘Aspect Oriented Programming’ Category

Matching a Joinpoint Based on Interface Implementation

Something I had a little trouble with while toying with aspects was getting a joinpoint pattern to match methods where the return type implemented some interface. I tried the following: execution(public AnInterface *(..)) But, that only works if I am returning the explicit interface as the return type… it doesn’t match if the return type [...]

One ElapsedTimeLogger Aspect to Rule Them All

Continuing from my last post, I decided to give a stab at making my aspect reusable in a way that I could apply it universally to any of those instances where I need to time the execution of some process and store the elapsed time in the result. It took a bit of work to [...]

Using AOP for Measuring Elapsed Time

Recently I’ve been knee deep in some legacy code doing a fair bit of refactoring, and one of the patterns I keep coming across is processes that need their elapsed time measured. You know what I’m talking about… a procedural mess shock full of primitive obsession all over, something like the following (except imagine that [...]

Subscribe to RSS Feed Follow me on Twitter!