DEV Community

Discussion on: Learn Spring Boot by Annotations

Collapse
 
rebaiahmed profile image
Ahmed Rebai
  • You can add to your blog @Aspect to add some Aspect-oriented programming to your project for example to handle Logging,
  • @EnableSwagger2 : to add swagger to your project and make some documentation for your API -And about Dependency injection, there are some opinions that said using injecting by constructor is better than by @Autowired, what about you?
Collapse
 
pmgysel profile image
Philipp Gysel

Hey Ahmed, thanks for the hints, both @Aspect and @EnableSwagger2 are important annotations! I am new myself to aspect oriented programming, but the concept is really interesting and I'll learn more about it myself in the future😀 As for the Swagger-docu, I have another post here that explains the annotation well: dev.to/pmgysel/log-capturing-app-w.... Finally, yes @Autowired is something I try to avoid and use constructor based dependency injection instead! I mostly just use @Autowired for test classes...