AOP is an idea of aspect programming. Of course, when a coding task is completed and some things are repetitive, you can consider using AOP programming to give some common things to it, we only care about business logic. There are two most useful scenarios:
I. Control database transactions. For example, if we have a business logic that needs to submit data and change the data, it involves data submission and rollback, therefore, the code for controlling data submission and rollback is extracted to AOP for implementation.
2. Permission Control and Permission control have the following scenarios: 1. I determine which roles have access permission, that is, some functions can be viewed by the Administrator, and some functions can be operated by the Administrator. 2, it can be used for the billing function design. No matter which function the user operates, it cannot be used as long as no fee is paid.
AOP design scenarios