What the following is not
This is not the copy of any tutorial. This is just my feeling about why I see SpringBoot as a tool that every Web/Java developer has to know – at least – that it exists.
Have you ever had such a feeling when starting new Spring project?
How was I supposed to start…
What do I need to start all this stuff
Thinking of all the WebApplicationInitializers and all Spring’s stuff all around can make it hard when just little project is to be started. With SpringBoot you have everything packed in one box. Just start and look! even Tomcat engine inside that can run all this stuff, full MVC Web app. Just one big fat jar, runnable one.
How to start? You have ton’s of tutorials. But basically this is the way how do I start..
Personally I like to initialize my app with initializer, rather initializr. You have better one? Please place your comment.
Code and be happy
But to be honest coding a controller it is nothing more than creating one
@Controller class with
@GetMapping and voila. All clients’ requests can be served now by your small WebAppServer. Sounds to you like microservice? I bet you are right.
Test before! or after, or .. anytime
No matter you believe TDD or not testing is important. Sometimes you just want to integrate-test something. And better you’ll do it with lots of Spring test tools, mentioning
@SpringBootTest for instance..
Having one fat jar it is easy to start it anywhere. Especially when I recall some little projects – using Docker it is very easy to build docker image with Java only than with Tomcat and deploying it. Of course it is possible but there is more Java-ready images on dockerhub than Tomcat’s images.
Make dev happy
Have you ever ‚sys-outed’ all the beans of your project? Or you were thinking how to reach all request mapping, list them? ‚Sysouting’ never again. Now everything is just under one project – actuator
Lots of hots, where are NOTs?
This is not the golden bullet. I would think twice before putting it as gateway for big production project – of course many will argue with that. But talking about smaller project? Building spring-like ProofOfConcepts? The best choice I think.