Context and Dependency Injection (CDI) (JSR 299) Basics

Topics

  • What is and Why Dependency Injection? 
  • What is and Why CDI (JSR 299)? What about JSR 330? 
  • CDI theme – Loose coupling with strong typing 
  • Bean definition (in the context of CDI) 
  • Basic dependency injection 
  • Qualifier 
  • @Named built-in qualifier 
  • Stateful objects (scoped objects) 
  • CDI for Java SE application

What is & Why Dependency Injection (DI)?

  • Classes specify what their dependencies are NOT how to obtain them 
    • “How to obtain” is now handled by the container 
  • Why Dependency injection? 
    • Dependency injection makes unit-testing and mocking easier 
    • Dependency injection allows container to do the bean-discovery and bean-wiring 
  • Dependency Injection frameworks (containers) 
    • Spring 
    • Guice
    • Seam 
    • EJB 3.x 
    • CDI (the latest, the best, and standard-based)

 

Download Course Content