Spring programming ideas

AOP(Aspect Oriented Programming)

Understanding: When it comes to AOP, we all know that it is aspect-oriented programming, and then we think of dynamic proxy, but dynamic proxy is only a technical implementation of AOP, and AOP is just a programming idea.
Case 1: We went to KFC to buy a hamburger. The top and bottom of the hamburger was a piece of bread, and there were layers of chicken, cream, and greens in the middle. It is the combination of these ingredients and a new name - the burger, which is several times more expensive. This reflects the idea of ​​a product enhancement.
Case 2: Only the combination of screws and nuts can reflect the value of a product. Neither screws nor nuts alone are perfect products. Now company A only produces nuts, while company B only produces screws. Both parties produce according to certain regulations , so as to ensure the perfect combination of nuts and screws .
write picture description here
Summary: AOP is aspect-oriented programming, which can also be understood as rule-oriented programming. The biggest feature of its aspect is function enhancement, combination, decoupling, and rule-making.

OOP(Object Oriented Programming)

Understanding: object-oriented programming (encapsulation, inheritance, polymorphism), using code to describe the world.

BOP(Bean Oriented Programming)

Understanding: The original java object was new constantly, and then kept assigning values ​​to properties. Spring felt that this was particularly unpleasant. Spring feels that it should be possible to find something to describe the relationship between beans and beans. It does not want to repeat the management artificially every time, but to realize automatic management by the program. So there is bean-oriented programming, BOP.

IOC(Inversion of Control)

Understanding: Inversion of control, inversion of control (new) of the created object. In the past, who used new, after spring, all beans are new from spring, so it is called inversion of control. Then, the objects after new need to be managed uniformly, so there is an IOC container. (Map)

DI (Dependency Injection)

Understanding: dependency injection, in order to solve the problem of dynamic assignment of objects (objects are managed by spring, the relationship between objects and objects needs to be maintained), dynamically call get and set methods (through reflection)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325604725&siteId=291194637