How you structure the creation of objects is a separate issue than the drop-down API .
Demeter’s Law says something about the API classes, not how they are built, so I don’t see a conflict between the Injection construct and the Demeter Law.
However, once you decide to use Dependency Injection, you should be careful to avoid ambiguity when it comes to creating objects. If you continue to offer a parameterless constructor or a static factory method, people can use this instead of letting the external caller build a hierarchy of dependencies.
Each time developers accidentally destroy the hierarchy of dependencies using the factory method (or a parameterless constructor), they introduce a hard link at this point. When you decide to use DI, you can best benefit from this in order to do this consistently.
source share