should we use annotations?

本文探讨了在软件项目中使用注解的条件,包括Java环境的要求及对生产数据库的选择。作者建议,在能够灵活选择Java 5环境并明确将使用的生产数据库时采用注解;而为了支持多种数据库,则推荐使用XML文件进行映射配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

should we use annotations?

If your answer is yes to the following questions then you can use annotations in your project.

1.Do you have the flexibility to use Java 5 Environment?
2.Do you have the knowledge of which production database you are going to use? 

If yes, you can use annotations, this brings in strong coupling. Inorder to support multiple databases, it is better to have the mapping information in a seperate xml file rather than using annotations. You can easily have multiple xml files each specific for a particular database rather than having a different sets of source codes.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值