Should I switch from Java EE to Spring Boot?
“I am a programmer, should I switch from Java EE to Spring Boot?”
Just to get it straight: It’s Jakarta EE now :)
Popular belief is that Java EE is only for the big, monolithic, legacy applications, whereas Spring Boot is for the microservices and cool new ventures, startups. (Not considering non-java stack now). This belief also drives fundamental technical decisions in businesses and projects.
I don’t think today (end of 2019) either of them are more technically superior to the other. If you can solve something with Spring Boot, you can also solve it with Java EE and vice versa.
Disclaimer: This post is not about which one is technically better and why (e.g. memory footprint or storage required) but rather a biased view of whether seasoned developer should abandon JEE in favor of Spring.
Be a little enterpreneurish
The question is more of where you want to position yourself as a software engineer
Which one have you already mastered?
If you already have significant amount of time invested in Java EE (like me more than 6 years), then you have significant leverage knowing all details, inner mechanics, pitfalls and best practices of this stack. For instance all the nitty-gritty details of JPA entity mapping types and annotations. If you switch, you have to relearn a lot of these details in Spring stack, however the learning path will be shorter as patterns tend to be generic especially between these two beasts. You don’t have to relearn concepts. Not to mention, many Spring projects integrate JAX-RS and JPA, so why even bother?
You will have to have some motive WHY you want to learn Spring Boot instead of Java EE.
What are you looking forward to work on?
Now this is a real reason. Because of the popular beliefs mentioned above, you have higher chance of working on cool new (especially microservices) projects with Spring Boot. It’s no secret that Spring Boot market penetration is a lot bigger than Java EE (see: https://jakarta.ee/documents/insights/2019-jakarta-ee-developer-survey.pdf), therefore you have a bigger pool of projects to choose from if you know Spring.
But Java EE is not only for the big, old, legacy monoliths. I beleive that there are forces beyond the material world that will give a new momentum to Jakarata EE. Seriously though. The adoptation of Java EE to the Eclipse foundation finished in mid 2019, and Eclipse promises faster release cycles to Jakarta EE. (see: https://jaxenter.com/understanding-jakarta-ee-series-rahman-147683.html). Eclipse Microprofile is already a key driver, adopted by Thorntail, Wildfly, Quarkus and many other application servers. Red Hat (< IBM) is also investing in it’s new Thorntail successor, Quarkus, as their first choice cloud native solution, that is building on Java EE specifications but with fast bootup and low memory footprint. These organizations have the goal to make Jakarta EE a real cloud native option. So if you haven’t switched to Spring Boot yet, maybe you should just stick to JEE.
Are you a jack of all trades, master of none?
You have invested multiple years in working with Java EE. Now you switch to Spring to broaden your skillset and increase your market value. Your Java EE knowledge will fade away where your Spring knowledge will take time to build up.
What you achieve is losing your competitive advantage in the Java EE stack and become mediocre in both stacks. Your market value will not increase, only your flexibility in choice of work you take.
Why will your market value not increase? Because first, most recruiters cannot distinguish between “J2EE” and Spring; and second, everyone knows if you are dropped on a Spring project, you will be productive within a day, and will master the relevant Spring technologies within months considering showing a good learning attitude.
Companies be like: the more junior you are, the more time you get to acquire the new skills. The more senior you are, knowing one particular technology weighs less in your overall awesome senior skillset (amongst wich should be the ability to learn). Except if the open position is really about a JEE or Spring tech lead. But then you should rather be the master of either and not both.
Are you a freelancer?
If you are doing project work of several months as a freelancer or consultant, then you should definitely learn Spring to give you job security. Who knows what the next project will be.
But Java EE is old and not good for microservices
Common misconception: Java EE 7/8 and Microprofile is cool. Besides of that, everything is good for microservices that you can put into a docker image. And for what is not in the Jakarta EE specification, you can always use a 3rd party dependency.
Jakarta EE has just begun to gain momentum. Don’t jump off the bandwagon just know. But even if you want to play safe, Java EE and Spring is conceptually so close to each other, that you never have to fear about not getting a Spring job because you only have JEE experience. If you feel like learning Spring then do it on the job!