Summary of Spring

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.