Aspect Oriented Programming (AOP) is becoming more popular and seems to be moving on to the mainstream. When the AOP movement started around 1997 (building on years of research on metaprogramming and reflection), I was fairly enthousiastic about it – it seemed a very promising thing. But the last few years I’ve become more skeptical.
Recently I read Ben Hogan’s post on Layered Architecture vs Living Domain Model. It confirmed my mixed feelings about the often dogmatic use of layered architectures: the use of layers seems to be unquestionable and this architecture is often applied without checking whether it really fits its context.
Now, AOP allows to model and implement concerns that cut across your design. So if you want to use a layered architecture and certain important concerns don’t fit in, you can (ab)use aspects to force the concerns in the design while holding on to the selected architecture. After reading Ben’s post, I realised that one of the things bothering me is that aspects can be easily used as a quick fix for a misfit architecture. I fear that this is one of the reasons AOP is getting more popular. Aspects will introduce extra complexity to the software and I wouldn’t like to maintain software containing aspects in this way…
I’m apparently not the only AOP skeptic. Patrick Logan writes
On the other hand, what if everyone realizes AOP is a nightmare from another era and moves to more simpler and expressive programming languages?