<p>I have been adding dependency injection to my code because it makes by code much easier to Unit test through mocking.</p>

<p>However I am requiring objects higher up my call chain to have knowledge of objects further down the call chain.</p>

<p>Does this break the Law of Demeter? If so does it matter?</p>

<p>for example: a class A has a dependency on an interface B, The implementation of this interface to use is injected into the constructor of class A. Anyone wanting to use class A must now also have a reference to an implementation of B. And can call its methods directly meaning and has knowledge of its sub components (interface B)</p>

<p>Wikipedia says about the law of Demeter:  "The fundamental notion is that a given object should assume as little as possible about the structure or properties of anything else (including its subcomponents)."</p>

Does it break the law?
Strictly speaking, I think it does.
Does it matter?
The main danger of breaking the law is that you make your code more brittle.
If you really keep it to just the tests, it seems like that danger is not too bad.
Mitigation
My understanding of the
Law of Demeter
is that it can be followed by having "wrapper methods" which prevent directly calling down into objects.