Arguments Against Annotations

前端 未结 12 1751
北海茫月
北海茫月 2020-12-23 13:48

My team is moving to Spring 3.0 and there are some people who want to start moving everything into Annotations. I just get a really bad feeling in my gut (code smell?) when

12条回答
  •  囚心锁ツ
    2020-12-23 14:01

    Actually I think that the bad feeling in your gut against has more to do with Annotations like this mixing configuration with code.

    Personally I feel the same way as you do, I would prefer to leave configuration (such as transaction definitions, path elements, URLs that a controller should be mapped to, etc.) outside of the code base itself and in external Spring XML context files.

    I think though that the correct approach here comes down to opinion and which method you prefer - I would predict that half the community would agree with the annotations approach and the other half would agree with the external configuration approach.

提交回复
热议问题