0
Java Spring Boot Annotations and Dependencies
Hey everyone. I have a question about annotations in Spring Boot. I’ve never used them before, I know @Controller/@RestController, @RequestMapping/@GetMapping, but that’s not enough to build a good functional web project using Spring Boot. What means the @Autowired annotation at all? I read about it a lot, but I don’t understand how to use dependency injection still. So, the main thing I should learn is dependency injection perhaps?
1 ответ
+ 2
The @Autowired annotation is used to inject the object dependency internally. You need not instantiate an object everytime using the 'new' keyword. This is generally achieved through either setter or constructor injection. The IoC container is responsible for creating and managing your objects.