Spring

CDI

Dependency Injection

  • handles DI in a static (aka: stateless) way
  • this means that components are wired together at creation time
  • handles DI in a dynamic (aka: stateful) way
  • this means that dependencies are resolved at execution time
  • it’s far superior and offers way more and advanced options

Ecosystem

  • comes bundled with a lot of jars (>150)
  • is pretty small by itself

a typical CDI-usage would be inside of a Java EE 6 application server, but you can easily make it work in a servlet engine or even Java SE. This means that using CDI makes no assumption about using Hibernate, JPA, EJB, or whatever - that’s up to you