- AOP (Aspect Oriented Programming) lets you focus on business logic by abstracting out common cross cutting concerns like logging, secutiy, performance metrics etc
- AOP should be used in such a way that even if disabled or broken the application should not be affected
- concern to be addressed
- usually cross cutting concerns like
- logging
- security
- transaction management
- performance metrics
- e.g., logging
- a regex like pattern to intercept target method, field etc
- e.g., when money is debited/credited from/to account
- the action to be taken on an aspect/target once intercepted by pointcut
- basically what to do with intercepted target
- e.g., the logging functionality
- execution of user defined behaviour at runtime
- execution of advice
- e.g., execution of logging code
- the process of wiring user defined behaviour to existing behavior and the excution is called weaving
- e.g., intercept the method that modifies money in account and successfully inject the required logging functionality