IOC refers to the delivery of the Instance interface or instance class to the IOC container (if the factory mode is understood as an IOC, there is no problem)
AOP is the weaving technology. To put it bluntly, the desired effect is to insert the method dynamically before, during, and after the method is executed.
First, let's talk about AOP. In fact, the principle is very simple. It is to wrap the instance you returned and add the method before each method of the instance. If there is no IOC here, this implementation willProgramStaff exposed,
After IOC is added, it is perfect.
The process is that IOC goes to the Instance Object and calls the AOP program to repackage the object during the instance. The final object returned to the programmer is the encapsulated object, that's simple. There are many methods to achieve this.
The most typical is sprint.net, which is implemented by emit in reflection.