Whether the inversion of dependency inversion needs to be changed

Source: Internet
Author: User

Many blogs or books will refer to dependency inversion, the example given is also the extraction interface to isolate two modules. So why call it inverted? And then most of the explanation: the previous design software can be from the high-level module calls the underlying module, so that the high-level module is heavily dependent on the underlying module, so to the upside. As for how to reverse the front is to rely on abstraction (interface). But where can you see the meaning of inversion? I think it should be explained in this way:

Even if high-level should not rely on the bottom, then upside down, is that the bottom layer depends on the high? In fact, what we have to do is to isolate each other through interfaces. High-level business needs to be reused, and the underlying modules need to be reused.
The so-called "upside down" personal feel is not really the code level of real dependency, but the realization of logic, the underlying function is based on the needs of the high-level set.

So I think the dependency inversion is more in line with the principle of dependency abstraction.

Whether the inversion of dependency inversion needs to be changed

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.