Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Introduction to CDI

Header Image

  1. Explanation of CDI and its benefits
    • This article explains what CDI is, its benefits, comparison with other frameworks, modularity and extensibility, and how to create CDI beans, inject dependencies, manage the lifecycle of a CDI bean, use CDI qualifiers, events, interceptors, and producers.
  2. Creating a CDI Bean
    • This article explains what a CDI bean is, how to create a CDI bean and specify its name using the @Named annotation.
  3. Dependency Injection in CDI
    • This article covers the basics of Dependency Injection in Contexts and Dependency Injection (CDI) and how to inject dependencies into CDI beans using the @Inject annotation.
  4. Managing the Lifecycle of a CDI Bean
    • This article explores the lifecycle of a CDI bean in Java EE, including the @PostConstruct and @PreDestroy annotations used for managing the bean’s initialization and destruction stages.
  5. Using CDI Qualifiers
    • This article explains the definition and usage of CDI qualifiers, custom annotations that allow differentiation between beans of the same type in a Contexts and Dependency Injection (CDI) framework.
  6. Using CDI Events
    • This article covers the definition and usage of CDI events in Java, including how to use the Event interface to fire an event, how to use the @Observes annotation to specify a method that should be called when a particular event is fired, and the benefits of using CDI events in your application.
  7. Using CDI Interceptors
    • This article covers the definition and usage of CDI interceptors, including how to create an interceptor class, bind it to methods with an interceptor binding annotation, and use the @Interceptor annotation to mark a class as an interceptor.
  8. Using CDI Producers
    • This article explains the definition of CDI producers, how to use them to create instances of custom beans, and how to use the @Produces annotation and qualifiers to differentiate between beans of the same type.

Table of contents