When wca4z generates Java modules from refactored COBOL services, why is dependency injection recommended for connecting modules?
Select an answer to reveal the explanation.
Short Explanation
Dependency injection is the right choice because it decouples Java modules at the object level, so you can swap implementations and write unit tests without hardwiring dependencies. Think of it like working hands-on with IBM mainframe systems: dependencies are provided at runtime, which keeps generated modules easier to maintain and test.
Full Explanation
Dependency injection decouples Java modules by providing dependencies at runtime rather than hardcoding them, simplifying unit testing with mocks and making it easy to replace implementations independently. It is not a licensing rule, not a way to avoid recompiling COBOL callers, and not the only way to pass DB2 connections.