Creating and configuring Java EE modules using annotations

The goal of Java™ EE 5 platform development is to minimize the number of artifacts that you have to create and maintain, thereby simplifying the development process. Java EE supports the injection of annotations into your source code, so that you can embed resources, dependencies, services, and life-cycle notifications in your source code, without having to maintain these artifacts elsewhere.

An annotation is a modifier or Metadata tag that provides additional data to Java classes, interfaces, constructors, methods, fields, parameters, and local variables. Annotations replace boilerplate code, common code that is required by certain applications. For example, an annotation can replace the paired interface and implementation required for a Web service. Annotations can also replace additional files that programs require, which are maintained separately. For example, annotations can replace the need for a separately maintained deployment descriptor for enterprise Java beans.

Annotations

Java EE provides annotations for the following tasks, among others:

Java EE defines a number of annotations that can be injected into your source code. To declare an annotation, you simply precede the keyword with an "at" sign (@).

package com.ibm.counter;

import javax.ejb.Stateless;

@Stateless

public class CounterBean {

}

For more information about the categories of annotations that Java EE supports, see Types of annotations.

 

Related concepts

Developing Java EE Applications

Java EE: Overview

Tools for Java EE development

Project facets

Defining Java EE applications

Securing enterprise applications

 

Related tasks

Setting Java EE preferences

Creating Java EE projects using wizards

Validating code in enterprise applications

Deploying Java EE applications

Migrating the specification level of Java EE projects

Defining your own Annotations

Adding annotations

Editing annotations

Removing annotations

Overridden annotations