ITWissen.info - Tech know how online

dependency inversion principle (DIP)

The Dependency Inversion Principle(DIP) states that in object-oriented programming the basis of a design is not the specific properties of modules, but their common features should be abstracted in a common interface. By the abstraction the no more relevant details of a module are faded out. With module delimited and independent parts of a software are designated - it can be objects or classes. The inversion of the dependencies is not to be confused with in object-oriented programming equally well-known principle of the inversion of the control flow, the Inversion OF Control( IoC).

An essential characteristic of object-oriented programming is to define modules with delimited responsibilities. The principle of inversion of dependencies assumes that a design based on modules should not create unnecessary dependencies by having these modules in turn use others. The alternative approach is based on the use of abstractions, considering only the details that are critical to a particular approach. Through an abstraction, generalized characteristics are summarized and form the basis for the Dependency Inversion Principle. However thereby dependencies are not reversed in the sense concretely, but the term of the dependence refers to the abstraction, on which again then the modules are dependent. In a programming language abstractions are converted finally by interfaces, which describe common characteristics of the modules. The modules are arranged again in hierarchies, so that the lowest level defines in each case the modules, which have special responsibilities. The modules of a higher level thus each define the interfaces for the level below.

Dependency Inversion Principle (DIP) is a departure from the classic top-down design, where new modules were added for each concrete expression. Instead, DIP abstracts the common properties to ultimately extract the minimum necessary features of a module.

Informations:
Englisch: dependency inversion principle - DIP
Updated at: 17.03.2010
#Words: 288
Links: dual inline package (DIP), object (O), interface (I/F), software (SW), optical fiber (fiber optics) (OF)
Translations: DE
Sharing:    

All rights reserved DATACOM Buchverlag GmbH © 2024