I'm a big fan of the Dependency Injection design pattern and I'm using it a lot.
I'm saying "design pattern" because when I'm thinking and talking about "DI" I don't think about frameworks,
big containers and a lot of magic. Instead, for me DI is a simple concept
of how you write your classes and put them together.
In the past I've used many DI frameworks like Guice, CDI/Weld, EJB and Spring. In other use cases (for example my SnakeFX game) I've done the DI by hand:
Simply put all dependencies of a class into the constructor of this class. In the main method you can now start to instantiate the classes you need starting by the ones that have no dependencies and can therefore be instantiated without constructor parameters needed. It's easy and this way you can't create cyclic dependencies by accident. Look at an old
version of the
DependencyInjector class of SnakeFX
to see what I mean.
Learning how to do the DI by hand was a real eye-opener for me. You can learn that DI is no magic at all and you
will lose all your fear from the big buzzword "Dependency Injection". It's nothing special. Simply a design pattern.