Articles

I’m still working on learning Rust. Beyond syntax, learning a language requires familiarizing oneself with its idioms and ecosystem. I’m at a point where I want to explore testing in Rust.

The Initial Problem

We have used Dependency Injection a lot – for ages on the JVM. Even if you’re not using a framework, Dependency Injection helps decouple components. Here’s a basic example:

Source de l’article sur DZONE

Well, the main.ts is the entry point for the Angular application. Here, we’re not able to query instances of services or get them injected because we’re outside of the Angular application. It looks like that storage object is completely decoupled from the Angular application as well, so any dependency injection you’re after you’d have to do yourself.

Also of note: while I can’t find any explicit documentation on this, Amazon’s example of this Storage class has all of its properties as static, so I’m not sure if the configuration is expecting an instance of a class at all.

Source de l’article sur DZONE