New answers tagged dependency-injection
In this case, CalcFoo() should take in an OsEarnDetailPoco. The method signature then becomes CalcFoo(OsEarnedDetailPoco data). Services are typically injected in a DI architecture. Data is usually passed around through method calls.
One perspective is that you always need a justification to mock, rather than a justification to use the real dependency. Mocked tests are, simply put, worse than real tests; they test less require more maintenance are harder to write produce both false positives and false negatives have results that are more difficult to interpret run slower (may vary ...
If the current requirements are that after login, you must always navigate to the screen indicated by the constant NavigableScreens.MyNextScreen, then that most likely isn't a dependency that should be injected. It is just a value that you pass on to another function anyway. However, NavigationManager looks to be a class with a fair bit of functionality in ...
In addition to the practical insight from Robert Harvey's answer, I think it's important to keep in mind that big picture, both schemes are doing equivalent things. There will be some sort of queuing involved, regardless of which scheme you choose. The difference will be where that logic lives. If there is resource contention with providing connections to ...
Top 50 recent answers are included