Skip to content

Latest commit

 

History

History
46 lines (38 loc) · 1.65 KB

AspectOrientedProgramming-AOP.md

File metadata and controls

46 lines (38 loc) · 1.65 KB

Aspect Oriented Programming-AOP

  • 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

1. static/compile time

1.1 aspect

  • concern to be addressed
  • usually cross cutting concerns like
    • logging
    • security
    • transaction management
    • performance metrics
  • e.g., logging

1.2 pointcut

  • a regex like pattern to intercept target method, field etc
  • e.g., when money is debited/credited from/to account

1.3 advice

  • 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

2. dynamic/runtime

2.1 jointpoint

  • execution of user defined behaviour at runtime
  • execution of advice
  • e.g., execution of logging code

2.2 weaving

  • 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

References