Joke Collection Website - Mood Talk - What are the functions of ioc and aop in spring? Why use ioc and aop? I was asked many times in the interview, demanding detailed and clear answers. ...

What are the functions of ioc and aop in spring? Why use ioc and aop? I was asked many times in the interview, demanding detailed and clear answers. ...

Still need to know, read more books!

IOC: Control inversion is a design pattern. The first meaning is the transfer of control right: from the traditional control dependence in the program to the control of the container; The second layer is dependency injection: separating interdependent objects and describing their dependencies in the spring configuration file. Their dependencies are established only when they are used. Simply put, you don't need a new object.

AOP: Aspect-oriented, which is a programming idea and a continuation of OOP. The non-core business in the system is extracted and processed separately. Such as transaction, logging and security. Simply put, you can do something before or after a program.

Both AOP and IOC of Spring are designed to solve the problem of high coupling of system code. Make the code highly reusable and easy to maintain.

But AOP and IOC are not unique to spring. spring makes them more flexible and convenient.