Wednesday, March 23, 2011

Aspect-oriented programming

AOP and policy injection has low adoption because the use cases suggested are not that important. After all, security and logging has already pretty robust frameworks in both .Net and Java, and other use cases seem just lame...

Instead, where AOP can actually help is to enforce the Open-Closed principle, because it gives you a better alternative to subclass the classes trying to avoid modification. Rather than create derived classes a developer can create aspects or policies that extend the behavior of the class without having to modify it or create a string dependency through rigid inheritance structure.