Inversion of Control - Implementation Techniques

Implementation Techniques

Implementation techniques are influenced by the computer language used.

In Java there are several basic techniques to implement inversion of control. These are:

  1. using a factory pattern
  2. using a service locator pattern
  3. using a dependency injection, for example:
    1. a constructor injection
    2. a setter injection
    3. an interface injection
  4. using a contextualized lookup

In an original article by Martin Fowler, the first three different techniques are discussed. In a description about inversion of control types, the last one is mentioned. Often the contextualized lookup will be accomplished using a service locator.

More important than the applied technique, however, is the optimization of the purposes.

Read more about this topic:  Inversion Of Control

Famous quotes containing the word techniques:

    The techniques of opening conversation are universal. I knew long ago and rediscovered that the best way to attract attention, help, and conversation is to be lost. A man who seeing his mother starving to death on a path kicks her in the stomach to clear the way, will cheerfully devote several hours of his time giving wrong directions to a total stranger who claims to be lost.
    John Steinbeck (1902–1968)