I have been a Java dev for 7+ years now and have never once enjoyed working with Spring / Hibernate / JPA. I much prefer dropping down to the web server itself without a framework and using a lower level SQL library.
I have worked at 3 places that used Spring and none of the projects were structured the same so the whole once you know spring you can join any team that uses it didn't work out very well.
Spring is a simpler alternative to JavaEE and evolves much quicker than the JavaEE specification, often times innovating where JavaEE would then follow and implement specifications only after Spring implemented it. Spring for example had @Autowired for ages, only in JavaEE6 did JavaEE get an equivalent @Inject. Some people prefer the slow-pace of JavaEE over Spring's more rapidly evolving specifications.
When the only options were JavaEE or Spring, your options were
1: go with JavaEE and get stuck in a JavaEE container (like JBoss); new functionality only became available every 5-or-so years and you were limited to the versions of JARs that your container offered you. Your deployable WARs were very small though since half the JARs were already embedded into the container.
2: go with Spring, don't have access to the majority of the JavaEE specifications (like JMS), build fully self-contained WAR files that were often 20MB+ in size, but you could easily move around between containers that were more lightweight (like Tomcat and Jetty)
AspectJ which Spring makes heavily use of for its annotations as well as weaving in things that would be hard to do with pure Java, made Spring nice to have in a project as it reduced a lot of boilerplate. Some people joke that Spring is considered Annotation Orientated Programming. After switching to Kotlin, AspectJ actually gets in my way and I no longer reap any benefits from it.
With modern frameworks / libraries and the appearance of microservice-frameworks like VertX, Ratpack, Dropwizard, etc, I've abandoned Spring completely since I no longer see any benefit in having a framework wrap every library I want to use with Spring boilerplate.
The above is completely my opinion and not intended to start a JavaEE VS Spring flamewar.
Rajkumar
Fullstack Developer.
Been working with Spring for over 8 years and I guess I can post my opinion here. When Spring was a buzzword, it was mainly because how JavaEE ecosystem was back then. Coupling a framework with a container is the stupidest thing to do and that's what JavaEE was. We had no option other than to look for alternative and that is when Spring was gaining traction, thanks to it's easy to configure(not too easy, but still better than JavaEE) and vast documentation.
We really enjoyed working with Spring back then, as we didn't had any exposure outside of that. Then things started developing in rapid manner. The once most touted Spring is now nothing but a bloatware(Well, Spring Boot and all you can argue, but I am playing with 30+MB WAR files, so not an lean framework anymore). More and more I learn about the individual libraries, more and more I keep my distance away from Spring. I am not hating Spring, but it is not fit enough to attract me today.
But the fact is, Spring was indeed an attractive option back then and I actually enjoyed working with it. (Hibernate, not much! I hate it). Not anymore. I started using Go for webapps, Kotlin in Android and with that in my hands, I don't see any benefit in using Spring now. This is just me!