Talk:Dependency inversion principle
Computer science Unassessed | |||||||||||||||||
|
Introduction
I miss a reference to the original author of this principle Robert C. Martin. The text in the presentation of the concept is the same as Martin wrote in several articles or books mentioned in the History section. --Klodr (talk) 01:08, 7 January 2013 (UTC)
Description
It's wrong that the interface which defines the services required by the higher layers is in the same package. That will result in an undesirable impact to re-usability of lower layers. For example, packages that defines persistence or logging sub-systems. The perfect DIP implementation requires that both layers depend on abstractions in separate libraries or packages. The dependency inversion is only by name, defining the policy as an abstraction of services, not for implementation or compilation.
--Klodr (talk) 01:08, 7 January 2013 (UTC)
Agree with Klodr. In fact, Martin said the same thing in The Dependency Inversion Principle[1]. Page 7, Section near Figure 4 "Abstract Layers" states: Each of the lower level layers are represented by an abstract class. The actual layers are then derived from these abstract classes. Each of the higher level classes uses the next lowest layer through the abstract interface. Thus, none of the layers depends upon any of the other layers. Instead, the layers depend upon abstract classes.
Perhaps this is my interpretation, but I actually read that the Abstract Classes (Interfaces) should form an entire Layer itself. This entire Layer should be Abstract.
--Gary.plattenburg (talk) 14:33, 26 August 2013 (UTC)
introduction rewrite request
The introduction does not clearly state the principle being discussed in the language of OOP. 'High-level', 'low-level', and 'module' could have several interpretations. It would be better to simply talk of classes and inheritance, which is the common language of OOP. I request that someone familiar with this subject write a better introduction. --BBUCommander (talk) 19:58, 28 January 2013 (UTC)