I am very new to spring, so I can ask a stupid question, but anyway ...
I created a Spring MVC 4.0 application.
my settings:
Controller β Service β DAO
at the controller level, I use 4 to 5 different @Autowired
variables, such as
@Autowired private ClientService clientService; @Autowired private CommentService commentService; @Autowired private SearchService searchService;
At the service level, I Autowire also several DAO
@Autowired SearchDAO searchDAO; @Autowired private ActivityDAO activityDAO; @Autowired private UserService userService;
I have about 10 different controllers, and in most of them I @Autowire
same services. So is my question or not?
Is it possible to use @Autowire
as many times as I need, or does it bring too much memory? Will this have some other effects for my application?
I am using Spring 4.0 + hibernate JPA
source share