• Creating and Using a Contexts and Dependency Injection (CDI) Stereotype

    CDI is one of several Java EE 6 features that help to integrate the web tier and the enterprise tier of the Java EE platform. CDI is a set of services that, used together, make it easy for developers to use enterprise beans along with JavaServer Faces technology in web applications. CDI also has many broader uses, allowing developers a great deal of flexibility to integrate various kinds of components in a loosely coupled but typesafe way.

    A CDI stereotype allows you to create a annotation that club together several  CDI annotations. For example, if we needed to create several CDI named beans with a scope of session, we would have to use two annotations in each of these beans,
    namely @Named and @SessionScoped. Instead of providing two annotations to each of the beans, you would create a stereotype, and then annotate the beans with it.

    Stereotypes can be particularly useful in large applications where you have a number of beans that perform similar functions.

    Duration: 30 minutes

    Release Date: 18-JAN-2013

    Created by: Paromita Dutta

Create a Review

Be the first to create a review for this content item!