CSC/ECE 517 Fall 2009/wiki3 5 SD: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
='''Dependency inversion principle''' =
== Introduction ==
In conventional application architecture, lower-level components are designed to be consumed by higher-level components which enable increasingly complex systems to be built. In this composition, higher-level components depend directly upon lower-level components to achieve some task. This dependency upon lower-level components makes applications rigid, fragile and immobile.
Goal of Dependency inversion principle is to decouple the high-level components from low-level components.


='''Dependency inversion principle''' =


== What is Dependency inversion principle? ==
Dependency inversion principle states that:
Dependency inversion principle states that:
<ol>
<ol>
Line 7: Line 16:
<li>Abstractions should not depend upon details. Details should depend upon abstractions.</li>
<li>Abstractions should not depend upon details. Details should depend upon abstractions.</li>
</ol>
</ol>
== Introduction ==
In conventional application architecture, lower-level components are designed to be consumed by higher-level components which enable increasingly complex systems to be built. In this composition, higher-level components depend directly upon lower-level components to achieve some task. This dependency upon lower-level components makes applications rigid, fragile and immobile.
Lets consider an example:

Revision as of 20:09, 14 November 2009

Dependency inversion principle

Introduction

In conventional application architecture, lower-level components are designed to be consumed by higher-level components which enable increasingly complex systems to be built. In this composition, higher-level components depend directly upon lower-level components to achieve some task. This dependency upon lower-level components makes applications rigid, fragile and immobile. Goal of Dependency inversion principle is to decouple the high-level components from low-level components.


What is Dependency inversion principle?

Dependency inversion principle states that:

  1. High-level modules should not depend on low-level modules. Both should depend on abstractions.
  2. Abstractions should not depend upon details. Details should depend upon abstractions.