Java Dependency injection: XML or annotations

后端 未结 10 2223
既然无缘
既然无缘 2020-12-23 09:45

Annotations becoming popular. Spring-3 supports them. CDI depends on them heavily (I can not use CDI with out of annotations, right?)

My question is why

10条回答
  •  自闭症患者
    2020-12-23 10:14

    "But what is bad about xml?" It's yet another file to manage and yet another place to have to go look for a bug. If your annotations are right next to your code it's much easier to mange and debug.

提交回复
热议问题