I am developing a web application using spring-mvc.
Now the @Controller, @Service and @Repository stereotypes are available.
I found @Controller particulary useful, specially because I am using
<context:component-scan base-package="my.cool.controller"/>
Now, regarding @Service and @Repository, so far looks like
- The exceptions are better handled if the class is annotated with the correct stereotype, ok, that is an advantage I acknowlegde
- I could use component-scan for services and DAOs/repositories, however I do not like the idea of using component-scan, since it slows the startup time of the application, and that is a key feature for me (even if it is only 1 sec and I redeploy once per week)
So, apart from the better exceptions, any other advantage at all? Does annotating classes have an impact on performance?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…