The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

jjenkov (13) [Avatar] Offline
Chapter 4 mentions that being able to change the bindings (the
configuration of the DI container) at runtime can be dangerous,
as it may lead to unforeseen type errors. But rebinding the configurations
of certain beans can also be an advantage during unit testing. If you use a
container with your production configuration during unit testing, it can be
handy to replace the factories of the beans you want to mock up. That way, when you request the unit (bean) to test from the container, it has already had the dependencies you want to mock up injected.