Global Information Lookup Global Information

Dependency inversion principle information


In object-oriented design, the dependency inversion principle is a specific methodology for loosely coupled software modules. When following this principle, the conventional dependency relationships established from high-level, policy-setting modules to low-level, dependency modules are reversed, thus rendering high-level modules independent of the low-level module implementation details. The principle states:[1]

  1. High-level modules should not import anything from low-level modules. Both should depend on abstractions (e.g., interfaces).
  2. Abstractions should not depend on details. Details (concrete implementations) should depend on abstractions.

By dictating that both high-level and low-level objects must depend on the same abstraction, this design principle inverts the way some people may think about object-oriented programming.[2]

The idea behind points A and B of this principle is that when designing the interaction between a high-level module and a low-level one, the interaction should be thought of as an abstract interaction between them. This not only has implications on the design of the high-level module, but also on the low-level one: the low-level one should be designed with the interaction in mind and it may be necessary to change its usage interface.

In many cases, thinking about the interaction in itself as an abstract concept allows the coupling of the components to be reduced without introducing additional coding patterns, allowing only a lighter and less implementation-dependent interaction schema.

When the discovered abstract interaction schema(s) between two modules is/are generic and the generalization makes sense, this design principle also leads to the following dependency inversion coding pattern.

  1. ^ Martin, Robert C. (2003). Agile Software Development, Principles, Patterns, and Practices. Prentice Hall. pp. 127–131. ISBN 978-0135974445.
  2. ^ Freeman, Eric; Freeman, Elisabeth; Kathy, Sierra; Bert, Bates (2004). Hendrickson, Mike; Loukides, Mike (eds.). Head First Design Patterns (paperback). Vol. 1. O'REILLY. ISBN 978-0-596-00712-6. Retrieved 2012-06-21.

and 20 Related for: Dependency inversion principle information

Request time (Page generated in 0.8912 seconds.)

Dependency inversion principle

Last Update:

design, the dependency inversion principle is a specific methodology for loosely coupled software modules. When following this principle, the conventional...

Word Count : 2158

Dependency injection

Last Update:

configurations? Dependency injection is often used to keep code in-line with the dependency inversion principle. In statically typed languages using dependency injection...

Word Count : 3452

Inversion of control

Last Update:

In software engineering, inversion of control (IoC) is a design principle in which custom-written portions of a computer program receive the flow of control...

Word Count : 1474

SOLID

Last Update:

segregation principle: "Clients should not be forced to depend upon interfaces that they do not use." The Dependency inversion principle: "Depend upon...

Word Count : 481

Interface segregation principle

Last Update:

Principle. Applied to the Xerox software, an interface layer between the Job class and its clients was added using the Dependency Inversion Principle...

Word Count : 603

Acyclic dependencies principle

Last Update:

The acyclic dependencies principle (ADP) is a software design principle defined by Robert C. Martin that states that "the dependency graph of packages...

Word Count : 275

Mixin

Last Update:

implemented methods. This pattern is an example of enforcing the dependency inversion principle. Mixins first appeared in Symbolics's object-oriented Flavors...

Word Count : 3225

Service locator pattern

Last Update:

with a simulator. Dependency injection Dependency inversion principle Java Naming and Directory Interface Fowler, Martin. "Inversion of Control Containers...

Word Count : 574

Leaky abstraction

Last Update:

be understood for effective usage of git. Abstraction inversion Dependency inversion principle Essential complexity Modular programming Separation of...

Word Count : 736

Dip

Last Update:

pneumonia Distal interphalangeal joint (disambiguation), in anatomy Dependency inversion principle, in software architecture design Device-independent pixel or...

Word Count : 547

Adapter pattern

Last Update:

Delegation, strongly relevant to the object adapter pattern. Dependency inversion principle, which can be thought of as applying the adapter pattern, when...

Word Count : 1935

Liskov substitution principle

Last Update:

The Liskov substitution principle (LSP) is a particular definition of a subtyping relation, called strong behavioral subtyping, that was initially introduced...

Word Count : 1191

Software package metrics

Last Update:

paths of packages participating in package dependency cycles. Dependency inversion principle – a method to reduce coupling (Martin 2002:127). Robert Cecil...

Word Count : 433

V2 word order

Last Update:

participate in inversion locative or temporal adverb first prepositional phrase first (see locative inversion, directive inversion) After the two latter...

Word Count : 7840

Reactive programming

Last Update:

explicit callbacks then results in the creation of implicit dependencies. Therefore, control inversion, which is induced via callback, is thus left in place...

Word Count : 3443

Loose coupling

Last Update:

one or many concrete classes. This is known as dependency inversion. The dependent class's dependency is to a "contract" specified by the interface; a...

Word Count : 1344

Free energy principle

Last Update:

The free energy principle is a theoretical framework suggesting that the brain reduces surprise or uncertainty by making predictions based on internal...

Word Count : 6217

Entity component system

Last Update:

of data, with systems which operate on the components. ECS follows the principle of composition over inheritance, meaning that every entity is defined...

Word Count : 1740

Syntax

Last Update:

of sentences. Dependency grammar is an approach to sentence structure in which syntactic units are arranged according to the dependency relation, as opposed...

Word Count : 2773

Link grammar

Last Update:

verb, and thus no specific indication of dependency needs to be made. In the case of subject-verb inversion, a distinct link type is employed. For free...

Word Count : 3141

PDF Search Engine © AllGlobal.net