What is the weaving of AOP

what is the weaving of AOP and what does it mean? ask God to answer what "weaving" means in popular words

Mar.20,2021

means to cut in

for example, if you call a method, there are several aspects:

  • before the method runs
  • method runs
  • after the method runs

if we want to do something before the method runs (logging, permission checking etc.),) and don't want to write a repetitive piece of code at the beginning of each method, we can look at the problem from an aspect.

cut into before the method runs, so that the specified part of the method executes our code before running, and then executes the method.

at the same time, from the outside, it is not aware of the pre-run operation , that is, the so-called low intrusiveness.

personal understanding, please correct any mistakes.

Menu