dependency injection

A collection of 7 posts

A Java geek
  • Me
  • Books
  • Speaking
  • Mentions
  • Focus
Oct 9, 2022 rust testing dependency injection

Different test scopes in Rust

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: class Car(private val engine: Engine) { fun start() { engine.

Nicolas Fränkel
Aug 26, 2018 dependency injection inversion of control

Back to basics: Dependency Injection

After years of near-ubiquitous usage of Dependency Injection, I see more and more posts and talks questioning its value. Some even go to the point where they argue against it. Most of it however is based on a whole lot of misconceptions, half-truths and blatant lies. In this post, I’d like to go back to the roots of DI, describe some related features and lists available frameworks.

Nicolas Fränkel
Jul 8, 2018 software design container dependency injection framework

On containers and frameworks

It seems pretty popular right now to bash widespread software design practices, e.g. dependency injection, frameworks, annotations, etc. While there are some downsides of adopting those practices, I believe there are more benefits. In that post, I’d like to address those points, and come up with arguments in favor.

Nicolas Fränkel
Nov 15, 2015 dependency injection language object oriented programming semantics

Semantics: state or dependency, not both

The more I program, the easier it gets. However, the more questions arise regarding programming. This week, my thinking was about Object-Oriented Programming. I’ve been told that OOP is about encapsulating state and behavior is a single isolated unit. In languages I know, state translates into attributes and behavior into methods. public class Cat { private Color color; public void mew() { ...

Nicolas Fränkel
Aug 2, 2015 android dagger dependency injection

Compile-time dependency injection tradeoffs in Android

As a backend software developer, I’m used to Spring as my favorite Dependency Injection engine. Alternatives include Java EE’s CDI which achieves the same result - in a different way. However, both inject at runtime: that means that there’s a definite performance cost to pay at the start of the application, the time it takes for all dependencies to be fulfilled.

Nicolas Fränkel
Sep 28, 2009 container dependency injection di ioc servlet spring

Spring can inject Servlets too!

In this article, I will show you that Spring dependency injection mechanism is not restricted solely to Spring-managed beans, that is Spring can inject its beans in objects created by the new keywords, servlets instantiated in the servlet container, and pretty anything you like.

Nicolas Fränkel
Mar 20, 2009 decoupling dependency dependency injection di meta-inf osgi service locator serviceloader services

Simplest Java decoupling without 3rd party frameworks

[…​] coupling (or dependency) is the degree to which each program module relies on each one of the other modules. — Wikipedia http://en.wikipedia.org/wiki/Coupling_(computer_science) In object-oriented programming, removing dependencies is done by using interface. Thus, if class A is dependent on class B, we introduce interface C, which is implemented by B. Now A depends on C  (see below). This first step in decoupling is called programming by interface.

Nicolas Fränkel
A Java geek © 2008-2026
v. bc04c88300c3ec997ce8470fbff5395dc9e518b1/13264050981
Latest Posts