Timeline for Criticism and disadvantages of dependency injection
Current License: CC BY-SA 4.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 21 at 15:18 | history | edited | Vilx- | CC BY-SA 4.0 | added 1930 characters in body |
| Feb 7, 2023 at 21:27 | history | edited | Vilx- | CC BY-SA 4.0 | added 282 characters in body |
| Feb 7, 2023 at 20:54 | comment | added | John Jiang | This is spot-on. Thinking back to the DI framework in my previous job still conjures up nightmare these days. | |
| Nov 7, 2020 at 16:28 | comment | added | Vilx- | @ahnbizcad - If you have a piece of code that can have several strategies then sure, go for interfaces or inheritance or whatever. That's what it's there for. But 90% of the time you don't. There's just one "PersonRepository" class, why hide it behind a IPersonRepository? When you're new to the project, this will just confuse you and make you spend hours looking for the implementation of that interface and how it got there. Later it will be easier, but still act like a speedbump every time you need to jump from an interface to an implementation, even if you know where to search. | |
| Nov 7, 2020 at 3:36 | comment | added | ahnbizcad | the alternative, displaying all the guts with long blocks of code with several strategies of them is even harder to read and harder to test. not knowing: the point is to duck type and not know the implementation details. you separate the high level from the low level. if that means "opaque", then i think you're picking at something that isn't the whole picture. >And when you work primarily with interfaces, all the "go to definition" features of your IDE go up in smoke. This sucks. | |
| Jun 3, 2018 at 19:15 | history | answered | Vilx- | CC BY-SA 4.0 |