Metadata Annotation vs Deployment Descriptor XML 的部分
@方面, 你可以x衿渲幸环N碓O定你的 EJB 相P配置c Resources ,
不一定完全需要使用 @Annotation !
如果你之前大量裼 XDoclet , 你就容^容易接受 @Annotation 的^念
resources 槭颤N要裼 XML ?! @是大多倒こ的思考行楸恢暗Framework 框架住了. f真的, _始的r候我也有c排斥, ^ saijone 的指c解f, 我X得 annotation is better
1. Compiling-Time Check
You can find the wrong setting in metadata annotations in compling-time, and u can't find it when u set each resource in the deployment descriptor, ( it will display error when u deploy it ).
2. Developing Simplification
Yap, use annotation, u just need one main BeanClass + BusinessInterface without any deployment descriptor (XML), when u wanna modify or setting some other resources in xml editing , u need another powerful tool like "XMLspy" or etc..
3. IDE integration
When u use the annotation with IDE ( new version which supported to JDK1.5 or Java EE 5.0 ) , u can ez to insert or modify ur annotation in the java files, Don't feel sucker, I think it is a great design in Java EE 5.0
You can view some opensources for IDE , ex, NetBeans or Eclipse!
4. You won't modify any resources in ur XML
Yap, XML is a great design for dynamic deploy for every great design.
if u need to change once and once, please use xml, *HOWEVER*, can u tell me , when u deploy one system to production mode , how many times u ever modified the deployment descriptors ?
so that , u alos can read the JSRs for getting more knowledge in annotation