Types
Martin Fowler identifies three ways in which an object can get a reference to an external module, according to the pattern used to provide the dependency:
- Type 1 or interface injection, in which the exported module provides an interface that its users must implement in order to get the dependencies at runtime.
- Type 2 or setter injection, in which the dependent module exposes a setter method that the framework uses to inject the dependency.
- Type 3 or constructor injection, in which the dependencies are provided through the class constructor.
It is possible for other frameworks to have other types of injection, beyond those presented above.
Read more about this topic: Dependency Injection
Famous quotes containing the word types:
“The American man is a very simple and cheap mechanism. The American woman I find a complicated and expensive one. Contrasts of feminine types are possible. I am not absolutely sure that there is more than one American man.”
—Henry Brooks Adams (18381918)
“As for types like my own, obscurely motivated by the conviction that our existence was worthless if we didnt make a turning point of it, we were assigned to the humanities, to poetry, philosophy, paintingthe nursery games of humankind, which had to be left behind when the age of science began. The humanities would be called upon to choose a wallpaper for the crypt, as the end drew near.”
—Saul Bellow (b. 1915)
“Our major universities are now stuck with an army of pedestrian, toadying careerists, Fifties types who wave around Sixties banners to conceal their record of ruthless, beaverlike tunneling to the top.”
—Camille Paglia (b. 1947)