Java EE5 and Java EE 6 support for annotations

Java EE5 and Java EE 6 support for annotations

The goal of Java™ EE5 and Java EE 6 platform development is to minimizethe number of artifacts that you have to create and maintain, therebysimplifying the development process. Java EE5 and Java EE 6 support the injection of annotationsinto your source code, so that you can embed resources, dependencies,services, and life-cycle notifications in your source code, withouthaving to maintain these artifacts elsewhere.

An annotation is a modifier or Metadata tag that provides additionaldata to Java classes, interfaces, constructors,methods, fields, parameters, and local variables. Annotations replaceboilerplate code, common code that is required by certain applications.For example, an annotation can replace the paired interface and implementationrequired for a Web service. Annotations can also replace additionalfiles that programs require, which are maintained separately. By usingan annotation, this separate file is no longer required. For example,annotations can replace the need for a separately maintained deploymentdescriptor for JavaBeans™.

Annotations
  • Replace descriptors for most purposes
  • Remove the need for marker interfaces (like java.rmi.Remote)
  • Allow application settings to be visible in the component theyaffect
Java EE 5 provides annotations for the following tasks, among others:
  • Developing Enterprise JavaBean applications
  • Defining and using Web services
  • Mapping Java technology classes to XML
  • Mapping Java technology classes to databases
  • Mapping methods to operations
  • Specifying external dependencies
  • Specirying deployment information, including security attributes
Java EE 5 defines a number of annotations thatcan be injected into your source code. To declare an annotation, yousimply precede the keyword with an "at" sign (@).
package com.ibm.counter;

import javax.ejb.Stateless;

@Stateless

public class CounterBean {

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值