5 ms·
How would you do DI abstractions using just functions? (Honest question) I am so much used to the idea of swapping out functionality (set of functions and a st
by leeman2016 3y ago
How would you do DI abstractions using just functions? (Honest question)
I am so much used to the idea of swapping out functionality (set of functions and a state). For example, just recently I had to swap out an Excel spreadsheet reader/writer library in Go for performance reasons, and would have bled a lot (due to refactoring) had it not been encapsulated as an interface.
- shortrounddev2 3y agoFunction pointers in a struct
- winstonewert 3y agoHow would either approach be different? In both cases you would have to rewrite the code that directly interacts with your Excel library.