This is more of a design question on AOP Usage. The classic usage of AOP has always been in security/logging/transaction etc. I am thinking of using AOP in more business context. I have a method that I need to call across multiple modules in some specific method. Is AOP appropriate here? The business method is not a pure Cross Cutting concern that affects all methods in the application but it does impact significant places. My thinking is that by using AOP can a centralize my code in a single place and prevent tight coupling as maybe I will change the signature of the method and then I will need to change all code that is calling that method. A friend of mine said that AOP should not be used as AOP should only be used non domain or business context.
I agree and disagree. It always depends on the use case. Is this something that you might want to remove later, or turn on and off at your whim. Then AOP is a great choice for it. Do you mind all the clutter/tangling code of the process in all your other code, that is needed but doesn't represent the Use Case of the method that you tangle this code in? Then AOP is a great choice for it.
But AOP is not the choice for everything. You really need to weight the pros and the cons, and know that sometimes debugging or determining where an error is coming from that might or might not be from AOP can be a little more difficult. Not with a great IDE that you can set break points, but sometimes you have to have two break points. One in the code before the AOP gets called, and one after in the real code. Because Proxies are being used.