Overview
The functions of spring are divided into 3 parts, as follows.
IOC and Di
Before learning Spring.net, the block content of the explanation, specific people can read this article: Spring.net in the IOC, DI and MVC, the supplement is to do the active find and passive lookup.
In the IOC and DI features provided by spring, two words are involved: Active lookup and Passive lookup
Active Lookup: Class A uses Class B, a class inside must pass new, or through Jdni lookup, or through the factory class to create Class B objects, OK, this is the active lookup. Class A must rely on something at the level of the code, that is, there must be a coupling before a Class B object can be obtained. Active lookup is also called dependency lookup.
Passive lookup: Class A using Class B, Class A only need to declare a Type B property, or type B of the parent type, the other does not need to tube, the direct use of the line, the rest will have something for you to inject inside, this is passive search, also known as passive acceptance, realize decoupling.
AOP
AOP All-English for aspect oriented programming, translation comes to the aspect programming. The purpose is to add the corresponding function without modifying the original code, which is transparent to the programmer.
Without AOP, program A, whose code flow is a-"B" c, we apply Spring's AOP to the program, namely: After the introduction of the appropriate jar, add the appropriate configuration in the configuration file (B before execution of the log records), at this time, the code process is a-"log records-" B "c. This process we did not modify the source program of any code, but our logging function into the program, such a lot of benefits, again no longer repeat.
Framework Integration
framework of the integration function, spring and many other frameworks have done the corresponding integration functions, how to hibernation,struts, make its application more extensive, for the late framework of the replacement, provides a guarantee.
Summary
Spring Framework is very powerful, and he is lightweight, about the rise of spring, in fact, can go to the EJB, the content of the EJB is not very clear, then have the opportunity to write the corresponding blog to share with you.
before learning. NET, I learned a basic framework of spring, the framework is spring.net, at that time, the study of spring.net is not very deep, the summary is not very deep, this time will spring, this time they are the same function, the following
Summary of Spring