I'm trying to figure out the best practise in Spring to develop a REST API.
I found those two packages and as far as I understand the difference between them is:
Is there anything that I'm missing? Most examples are on top of web so I wonder what decisions points would lead me to favor one over the other in my app.
Difference Between Spring Boot Starter Web and Spring Boot Starter Tomcat. Spring Boot Starter Web is used for building RESTful applications using Spring MVC. Spring Boot Starter Tomcat is the default embedded container for Spring Boot Starter Web. We cannot exclude it while using web services.
Spring Data REST builds on top of Spring Data repositories, analyzes your application's domain model and exposes hypermedia-driven HTTP resources for aggregates contained in the model.
Spring Boot is a Java framework, built on top of the Spring, used for developing web applications. It allows you to create REST APIs with minimal configurations. A few benefits of using Spring Boot for your REST APIs include: No requirement for complex XML configurations.
Spring Data JDBC is a persistence framework that is not as complex as Spring Data JPA. It doesn't provide cache, lazy loading, write-behind, or many other features of JPA.
Well it depends on what you want. Both are -web- starters (they make easy to add jars to your classpath) that will help you make a REST API, but data-rest has a more specific purpose, it help you to expose repositories as a REST services (In fact if you see their pom.xml, data-rest depends on stater-web). If that is what you want, voila! But if you want more control over the data, controllers, validation or project structure, stater-web is your option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With