CSC/ECE 517 Fall 2009/wiki3 5 rm

From Expertiza_Wiki
Revision as of 17:16, 18 November 2009 by Rdflterr (talk | contribs)
Jump to navigation Jump to search

Dependency Inversion policy

Introduction

The Dependency Inversion Principle has been proposed by Robert C. Martin. It states that:

"High level modules should not depend upon low level modules. Both should depend upon abstractions. Abstractions should not depend upon details. Details should depend upon abstractions."

The principle is reverse the conventional philosophy of high level functions in softwares need to depend on the low level functions. The principle states that high level or low level modules should not depend upon each other, instead they should depend upon abstractions. Further it also states that these abstractions should not depend on the details and inversely the details should depend on the abstractions. According to this principle the way of designing a class structure is to start from high level modules to the low level modules:

High Level Classes → Abstraction Layer → Low Level Classes