What is aspect-oriented programming?

what is aspect-oriented programming? Read some articles, I do not know whether the article is not clear or I do not understand clearly, read or do not know what it is useful and how to use, please say again to the boss.

Aop
Oct.15,2021

< hr >

about my understanding of
1.oop, all the required classes are written before compilation, and the code can't be moved at run time.
2.aop refers to dynamically generating code into your class during compilation and execution.

< hr >

an analogy (just pointing out the difference)

oop
aop

in short, creating a code snippet that can generate code is called a tangent, and creating a code snippet that can be cut into the code is called a pointcut. Taken together, it's called aspect-oriented
advantage: the code is more concise, and if you add time control, it will become more flexible.
disadvantage: I think it is not mature yet. If aop does not have a strict specification, its readability will be very poor and it will be difficult to maintain.


like AOP in springboot
for example, now I have a Web project, and now I want to type log.info
when a user requests each path, and now my approach is to add log.info ("..") to each method, which is a lot of work
, or I use @ RequestMapping () as a pointcut, write a piece of code, cut into it, and don't have to change the original. Code reuse is realized, which reduces the degree of coupling between various business logic

.

imagine that there are functional modules, layer by layer, data is transmitted from top to bottom, and modules with the same function are placed on the same layer. Now I have made a very thin section to insert the gap between layers. Pull out

at any time when you don't need it.

https://www.cnblogs.com/liuru.
Baidu aop, or surf the Internet to find an example. Or find a back end to ask


take a look at this https://codeshelper.com/a/11.


burying points / piling / inserting holes, so simply understand.
treats similar points as aop, for example, if I insert a row of eyes in a wild area, but the opposite widow dares not come over, then this row of eyes is like a wall.
logging I can embed the output in each method, but I can also reflect and inject the logging code into these methods (actually proxies), so that I can create a wheel of non-intrusive burying points, such as spring aop

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9fd2c-1a87.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9fd2c-1a87.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?