Talk:Dependency injection/Archives/2009/January

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Sans-serif font confused me

Since loC (L) and IoC (i) were confusing readers, I changed all "IoC" to "IOC" as people suggested here. Ramiro Pereira de Magalhães (talk) 22:50, 8 January 2009 (UTC)


Merging with Dependency inversion principle

The Dependency inversion principle barely manage to define its concept, and if fails to differentiate itself from Inversion of Control and Dependency injection, mudding these already unclear pages. Since the goal of dependency injection is to follow the dependency inversion principle, I suggest to merge both and achieve a stronger article, instead of two weak ones. Diego (talk) 08:54, 10 June 2008 (UTC)

Thinking about it, Dependency injection and the Dependency inversion principle are different enough concepts to have different articles for them (the first is a technique, the second is an guideline to apply it). What is really needed is a rationale explaining how these concepts relate to each other and to Inversion of control. Diego (talk) 15:02, 12 June 2008 (UTC)
Just based on the fact that the contents of Dependency inversion principle article contains so little content, it shouldn't be on it's own. If at some point it becomes a distraction to the point of the Dependency injection article (not that I think it would), it could be split. —Preceding unsigned comment added by 12.21.236.10 (talk) 12:47, 19 June 2008 (UTC)
Yes, that was my idea in proposing the merger. But how do you address the problem of having to related (but different) concepts and emphasize that difference, when both are in the same article? Diego (talk) 13:53, 19 June 2008 (UTC)
While the Dependency inversion principle page may very well be anemic at this point, this principle does indeed describe something very different from Dependency injection. The Dependency Inversion Principle is primarily about having lower-level components depend upon higher level components rather than the conventional dependency relationship. The prescribed methodology by Robert Martin is to package a higher-level component together with an interface which defines the external behavior/services it needs. An external dependency in a separate package then implements the interface of the higher-level component, thus taking on the higher-level package as a dependency of itself. Once this decoupling has been achieved, some facility has to be used to enable the higher-level component to obtain an implementation of its interface. Dependency injection is one technique for facilitating this, but it isn't the only one. Another method would be use of the Plugin pattern (PoEAA), or Service Locator. Dependency injection is about externalizing the provisioning of dependencies and need not necessarily even involve the use of abstractions. It certainly isn't concerned with the dependency relationships between higher-level and lower-level components. I believe that combining these too topics together is detrimental to the clear understanding of each. My suggestion would be to supply a more robust description of the Dependency Inversion Principle and keep this article purely about Dependency injection. - Derek

I agree with Derek and, since Diego changed his mind about merging and no one has posted any new comments since June 2008, I'm removing the merge proposal announcement from the article.Ramiro Pereira de Magalhães (talk) 22:43, 10 January 2009 (UTC)