IOC control reversal and DI dependency injection difference

Source: Internet
Author: User

Contact with these two concepts is often confused in the head, and a lot of information is not clear, even confused. After learning spring, we found that these two concepts are different periods of the spring core idea of the description, here is not much to say, there are many online data. It's always indefinitely to learn spring before you understand these two concepts, and finally get a thorough understanding today.

Simple:

IOC control reversal: It's about creating control of object instances from code control stripping to IOC container control, which is actually your control over XML files, focusing on the principle.

DI Dependency injection: It says that when you create an object instance, you inject a property value or other object instance for that object, focusing on the implementation.

They are a description of different aspects of the spring core idea.

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.