Wednesday, December 5, 2007

AOP - Need to explore more..

When I came across AspectJ first time, I was unsure how to use it effectively. And when I started exploring it, i was amazed by the enormous capability it has, power to create highly modular and clean design. AspectJ and in turn, Aspect Oriented programming (AOP) has lot of potential to solve our programming hurdles. Still I am exploring the field and checking the places where it can be used effectively.

In my last project, I used AOP mostly for logging and once for authentication (thanks to people who worked on it). But there are lot of much more serious things that can be done.

It depends on us how we can separate our code into aspects and have the "multidimensional" programming code rather than mixing all the aspects into single dimension. Obviously, AOP is not here to replace OOP. Both AOP and OOP need to collaborate to produce the most modular and maintainable code. In fact, AOP allows us to address the problems that are (to some extent) out of scope of OOP.

I think, the excellent OOP design can partially address some of the issues that AOP is solving. So, why to use AOP ? The most obvious answer is AOP is better way of doing it !! Its best suited for addressing the crosscutting concerns. And we always prefer better and cleaner way of doing things. Practically, there is no program that can not be written using machine language or even brainfuck (which is one of those Turing complete esoteric programming languages). But still we use Java and C++ because they are address the problems more effectively and easily !!

No comments: