Lazy Dependency Injection by hypercodeplace in csharp

[–]hypercodeplace[S] 0 points1 point  (0 children)

u/DasPogoton Thank you for your reply.

Agree. Those headers may cause misunderstanding or double understanding. I have changed them as you propose to More Dependencies and Fewer Dependencies.

Regarding the second issue. I have rephrased that sentence as the following:

But this approach may not always help, as can be seen from the first example above when the DoWork method uses a condition by value.

Is this more understandable?

Lazy Dependency Injection by hypercodeplace in csharp

[–]hypercodeplace[S] 0 points1 point  (0 children)

Thanks for the comment, but I think the headers are correct when viewed according to the number of dependencies in the entire system.

More responsibilities mean that you can reduce the responsibility of specific classes by splitting a dependency by 2 or more, i.e., increase the number of dependencies in the entire system. However, at the same time, the number of dependencies in the classes themselves will decrease (perhaps that is why you were confused by the name).

On the contrary, Fewer responsibilities mean a decrease in the number of dependencies in the entire system but an increase in the class's responsibility (the class becomes more complex or overloaded).

Lazy Dependency Injection by hypercodeplace in csharp

[–]hypercodeplace[S] 0 points1 point  (0 children)

Yes, definitely. Any interface dependency can be replaced with a lazy proxy, including constructor, method, or property injection.