JAVA 技术开发标准
JAVA 技术开发标准中强调了注释的重要性,注释可以增加代码的清晰度,帮助其他开发者更好地理解代码。JAVA 中有三种注释方法:单行注释符(//),块注释符(/* */)和文档注释(/ */).
单行注释符(//)用于对一行代码添加讲明型描述,例如:
```
int level; // indentation level
int size; // size of table
```
块注释符(/* */)用于注释一段代码或添加多行讲明,例如:
```
/*
* Here is a block comment.
* Comment continues…
* 如果该文件不是修改人创建的,还需要添加修改人,时刻等信息
*/
```
文档注释(/ */)用于生成文档,例如:
```
/
* <p>Title: 续期收费要求对象</p>
* <p>Description: 封装页面提交的要求数据</p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: Co., Ltd.</p>
* @since 2008-08-20
* @author Kevin Qiu
* @version 1.0
*/
public class RenewChargeRO {}
```
方法注释也是非常重要的,例如:
```
/
* 查询续期应收费用列表:查询指定保单号码保单的续期应收费用信息,
* 如果是修改,还应注明修改人及修改时刻 <BR>
* @param sPolicyCode 保单号码
* @return Collection of RenewChargeVO 应收费用信息列表
* @throws Exception 所有发生可能的专门
*/
public Collection getRenewChargeList(String sPolicyCode) throws Exception;
```
BEANS 定义规范中也提到了字段名称的取法、String 类型的长度定义、Double、Float 类型的长度及精度定义、唯一索引的定义等。例如:
```
@Column(nullable = true,length =10)
@Column(nullable = true,precision=14, scale=2)
@Column(nullable = true,length =15,unique=true)
@Table(name=sys_clnt,uniqueConstraints={@UniqueConstraint(columnNames={clntid,simpname})})
```
JAVA 技术开发标准强调了注释的重要性和详细的编码规范,以便提高代码的可读性和维护性。