Dependency injection via inversion of control

Source: Internet
Author: User
Dependency Injection di is a programming pattern and architecture model, sometimes referred to as inversion of control, although, technically, dependency injection is a special implementation of IOC, dependency injection refers to an object applying another object to provide a special ability, For example, a database connection is passed to an object's structure method instead of creating a connection within that object itself. The basic idea of control inversion and dependency injection is to transform the dependency of a class from inside the class to the outside to reduce the dependency application control inversion, when the object is created, by an external entity that regulates all objects within the system, and passes the reference of the object it relies on to it. It can also be said that the dependency is injected into the object. So, control reversal is a reversal of this responsibility about how an object obtains a reference to the object he relies on.

  

Dependency injection via inversion of control

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.