The goal of Java™ EE 5 and Java EE 6 platform development is to minimize the number of artifacts that you have to create and maintain, thereby simplifying the development process. Java EE 5 and Java EE 6 support 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. By using an annotation, this separate file is no longer required. For example, annotations can replace the need for a separately maintained deployment descriptor for JavaBeans™.
package com.ibm.counter; import javax.ejb.Stateless; @Stateless public class CounterBean { }
For more information about the categories of annotations that Java EE 5 and Java EE 6 support, see Types of annotations.