4 ms·
I don't mind DI, in Angular or elsewhere. I'm not sure in what way you think of it as a DSL, or even that it requires tooling. It's a useful pattern in OOP.
by msane 10y ago
I don't mind DI, in Angular or elsewhere. I'm not sure in what way you think of it as a DSL, or even that it requires tooling. It's a useful pattern in OOP.
- _greim_ 10y agoDI is great; DI isn't the problem at all. It's rather the fact that Angular baked in a DI implementation that doesn't play well with either static analysis tools or module loaders. I'm not even criticizing the creators of Angular; they did something that made sense at the time and worked, in its way. It's just that Angular DI is icky and I hope to never have to deal with it again.
- novembermike 10y agoDI is fine, but that's just the concept that you ask for dependencies rather than relying on them. foo(X dep) {} vs foo() {X dep = new X()} It's overused imo but it's fine. The problem comes with DI frameworks like Spring or Angular DI when you start letting the framework tie your code together. This couples you tightly with the framework and can lead to odd situations where the thing you're getting isn't what you're expecting but that's not obvious because the object passing is happening behind a curtain.