欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

should we use annotations?  

程序员文章站 2022-06-08 09:01:51
...

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.