[Original]java Web learning Note 97:spring Learn---Bean configuration in Spring: IOC and DI

Source: Internet
Author: User

The purpose of this blog: ① summary of their own learning process, equivalent to study notes ② to share their own experience to everyone, learn from each other, communication, not commercial content inevitably appear problems, welcome to correct, exchange, discussion, you can leave a message, can also be contacted by the following ways. I Internet technology enthusiasts, Internet technology enthusiasts Weibo: Ivan is in 0221 qq:951226918

--------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- -----------------------------

1.IOC and DI

1) IOC (inversion of Control): The idea is to reverse the direction of resource acquisition . The traditional resource lookup method requires that the component initiate a request lookup resource to the container. In response, the container returns resources in a timely manner. When the IOC is applied, it is the container that proactively pushes the resources to the components it manages, and what the component does is to choose an appropriate way to accept resources . This behavior is also known as the passive form of finding

2) Another way to express DI (Dependency injection)-IOC is that the component accepts resource injections from such containers in a pre-defined way (for example, setter methods) . In contrast to the IOC, this statement is more straightforward

2. Comparison between traditional and IOC methods

Evolution of the 3.IOC

  

3---

[Original]java Web learning Note 97:spring Learn---Bean configuration in Spring: IOC and DI

Related Article

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.