This is an automated archive made by the Lemmit Bot.
The original was posted on /r/java by /u/cryptos6 on 2023-10-25 10:10:45.
Spring Boot is seemingly the default option for most business applications. It is mature, offers a lot features and working with it can be quite productive, once your mastered it. However, there is also some historical cruft in this framework and I see younger developers struggle with it and preferring JavaScript stuff like Nest.js or Go.
I even think that all the annotations typical for JEE and Spring are there mostly for historical reasons, because Java before 8 was very cumbersome to write. Today you could write transaction handling using lambda expressions like this:
public void cancelOrder(OrderId id) {
transaction.execute(() -> {
var order = repository.findById(id);
order.cancel();
});
}
Before lambda expression such an approach required implementing an ugly (anonymous) class with a certain interface. Therefore @Transactional
and friends made it much more practical and readable. But there are downsides: magic everywhere and less help provided by the compiler or IDE (although IDEs implemented much functionality related to annotation magic). There is a reason, why Spring is sometimes called “stacktrace obfuscation framework” … 😉
So, long story short: What less magical, mostly annotation free stack would you suggest? I’m thinking of a full stack with web, validation, dependency injection, ORM, and maybe also messaging (JMS …). After some years with Spring, I’d like to try something more clear and lightweight, but not nothing super limited.