Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
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 Resposta
+ 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.