DAGDA SEARCH | Back to results | Support

Dependency Injection Pattern - Python Wiki

Source: https://wiki.python.org/python/archive/DependencyInjectionPattern.html

  1. Python Wiki /
  2. Python Wiki /
  3. Archive /
  4. Dependency Injection Pattern
View as Markdown

Dependency Injection Pattern

Legacy Wiki Page

This page was migrated from the old MoinMoin-based wiki. Information may be outdated or no longer applicable. For current documentation, see python.org.

Dependency Injection Pattern

The Dependency Injection Pattern, is described in Martin Fowler’s article. It is closely related to the DependencyInversionPrinciple and the so called Inversion of Control (IoC) containers.

IoC is aimed at loosening the coupling of application components. The key concepts are:

It is quite a challenge to implement an IoC container for statically typed languages. In python, however, the core concepts can be implemented quite easily. DependencyInjectionThePythonWay describes how.

See Also

PEAK:InversionOfControl – Inversion of Control is a more general concept (small components relinquishing control, or networking control, rather than maintaining it internally,) but the name was overloaded historically to mean what is named by DependencyInjectionPattern. PEAK makes use of dependency injection, and the larger meaning of “Inversion of Control.” The target page describes dependency injection.

Discussion

PreviousDelegation Event Model Next Desert Py