|
|
|
|
|
by dgb23
1546 days ago
|
|
I want to expand on what you said: It's more than just OOP, or not necessarily OOP in general that needs this type of DI and IOC. It's a specific category of OO architecture, where effects and state are buried under domain logic and information processing (via DI). If you keep that part data oriented and pragmatically functional, then you get a very testable core. Meaning no mocks, stubbing setup/tear-down (...) are required. No additional interfaces have to be specified that you didn't need in the first place. Tests are way simpler this way. You can still use objects, interfaces and composition etc. for domain logic and information processing if you want. Point is you lift state and effects up, so this stuff happens at the edge of your program that calls into a simpler core. |
|