What's AOP in Java
Yesterday in a interview I was asked what's AOP and how to use it. The two interviewers
I was wordless then so I came back to read the documentation.
It turns out AOP is simple. It's like emacs lisp's defadvice but less powerful. I've been using this since day one on different languages.
Please read slashdot discussion about AOP.
Here is the comment from MarkusQ,
by MarkusQ (450076) on Sunday April 24, 2005 @11:01PM (#12333504) Journal Exactly. When I implemented this sort of thing for a project in Ruby a few years back, I just grabbed all the CLOS nomenclature because I was familiar with it. I didn't even realize I was using "AOP with funny names" until someone reading the code mentioned it. When he asked why I didn't use the "standard" terminology, I lent him a copy of "Object Oriented Programing in Common Lisp" (c) 1988, and asked why the AOP people had to invent new words for everything. I have yet to get an answer. --MarkusQ
So it's just some enterprise guy inventing new buzz words (cross-cutting concern, for example) on some old idea.
Now as guy who got seven years academical training on system design (Bachelor and Master degree in system controlling major from best engineering school in China), I will give you some precious advice on how to use this thing (AOP in java, API hook in C, defadvice in Emacs lisp or whatever the buzz word is):
DO NOT USE IT IN ANY REAL SYSTEM OR APPLICATION!
Here are the reasons:
- The code change an external API's behavior
- The code's location is not close to the API's
- The system being corrupt quickly with those AOP things