2 ms·
This article seems to attract Spring sceptics or even haters. Spring is not that bad. First, XML configuration in Spring is mostly a thing of the past. Most ap
by cryptos 4y ago
This article seems to attract Spring sceptics or even haters. Spring is not that bad.
First, XML configuration in Spring is mostly a thing of the past. Most applications are configured with annotations and component scan these days. While it is true that there is some magic in it, it is relatively rare to cause problems. With proper tooling like IntelliJ Ultimate it is mostly easy to manage and understand. If that still feels too magical, you can use a Java API to manage your classes: https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#beans-java-basic-concepts https://docs.spring.io/spring-framework/docs/current/referen... Even nicer in the Kotlin edition: https://docs.spring.io/spring-framework/docs/5.0.0.RELEASE/spring-framework-reference/kotlin.html#bean-definition-dsl https://docs.spring.io/spring-framework/docs/5.0.0.RELEASE/s...
> Importing other Spring files
That sounds like mixing different projects or poor API design.
> Spring is now so complex that it has it's own framework, Spring Boot
That is not true as such. Spring Boot is not an abstraction over the Spring Framework. It is more a convenience layer with useful defaults and some auto-configuration.
From my experience Spring brings some advantages:
- Quick start with https://start.spring.io/ https://start.spring.io/
- Auto-configuration of several frameworks like Hibernate, Spring sets up all the project infrastructure for you
- Transactions are provided out of the box
- Useful additions like metrics can be added almost without effort
- Good support for integration tests
- Easy to use AOP
- Powerful dependency injection (for example the support for generics is pretty good)