4 ms·
Kotlin + Spring Boot is pretty nice and going to get nicer as the Spring people roll out more Kotlin friendly features and DSLs. The trick with Spring Boot is
by jillesvangurp 6y ago
Kotlin + Spring Boot is pretty nice and going to get nicer as the Spring people roll out more Kotlin friendly features and DSLs.
The trick with Spring Boot is to keep things simple and avoid some of the stuff that is there for legacy code bases. Also, there is a lot of complexity lurking in using stuff like JPA (which I tend to avoid), spring data (like wise), spring-batcg and a few other things that IMHO are not so great. But the core of spring's dependency injection and e.g. MVC with kotlin's co-routines is pretty nice. If you want graphql, there's a great spring library for that from expedia that makes this super easy to setup.
The reason javalin and other frameworks are not mentioned is because it's part of an enormous long tail of stuff. A quarter of a century of Java means that there are a lot of things out there that are still being maintained and actively developed.
Technically, Spring MVC and Spring Boot are the actually the same thing pretty much. Spring Boot basically just packages up Spring 5.x with a lot of convenient things. I've actually migrated a few old spring projects to spring boot at some point.
- andor 6y agoSpring MVC and Boot are not the same thing. Spring Boot is a "convention over configuration" framework for modern 12-factor apps. It integrates the other Spring libraries (like MVC) by providing "starters" that come with a basic configuration. For instance, adding the Spring Security starter package automatically configures Basic Authentication for all endpoints. Spring MVC is the Servlet-based web library, it includes functionality for serving HTTP endpoints as well as an HTTP client. This is in contrast to Spring Webflux which is the new reactive web library. It also includes server and client functionality. Neither are required in a Spring Boot app though.
- ptx 6y agoOne extremely useful part of Spring Boot is spring-boot-starter-parent, which specifies a compatible set of versions for all the various dependencies you're likely to pull in, which is otherwise tricky and tedious.
- jillesvangurp 6y agoI wasn't equating them just merely stating that MVC, Flux, and lots of other things are part of Spring 5.x. Spring Boot technically is basically a lot of auto configuration around a large amount of spring libraries and third party components. You could replicate pretty much all of what it does by adding those dependencies manually and manually configuring them. That's pretty much how Spring used to work before Spring Boot became a thing (been there done that). It's actually not that hard if you keep it simple.
- noisy_boy 6y ago> Also, there is a lot of complexity lurking in using stuff like JPA (which I tend to avoid), spring data (like wise), spring-batcg and a few other things that IMHO are not so great. If you are accessing databases, JPA/Spring Data are pretty much the most common options. For typical use cases, the configuration is straightforward and features like Query Creation[0] can get rid of so much boilerplate. [0]: https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#jpa.query-methods.query-creation https://docs.spring.io/spring-data/jpa/docs/current/referenc...