3 ms·
Passing a single "context" struct/class/whatever into everything basically solves DI. I can see using a framework for this, but it doesn't seem necessary.
by hot_gril 4y ago
Passing a single "context" struct/class/whatever into everything basically solves DI. I can see using a framework for this, but it doesn't seem necessary.
- javcasas 4y agoFurthermore, this enables creating sub-contexts (like run this operation but with this different configuration) which is something almost impossible to do with DI frameworks.
- hot_gril 4y agoYeah, it's weird how such heavy frameworks often end up lacking basic features like this. That's like the first thing I'd look up how to do after the basic tutorial.
- aforwardslash 4y agoThat is DI. The difference is that you're using a registry or container object as your DI repository.
- hot_gril 4y agoI know. DI is solved easily without a framework. Idk why there's even a word for DI; never occurred to me how else you're supposed to code (globals?).