Spring Boot – Introduction

What ?????? Spring Boot?? I mean , seriously?? Whats wrong with the people in Spring Community ..!! and that to “BOOT” ..!!

Is it some kind of Boot???

1.Spring_Boot0

Trust me, when i heard it for the first time even i could not digest it. But yeah once you learn it , am sure you are gonna love it and the name too.
If you have worked in any spring based application then am sure you know the pain of configuring the application, managing the dependencies .If you miss
any jar file then your project will end up in some ClassNotFoundException and there are so many.Though here we are not blaming spring because this is what we love about spring. Making most of the things configurable.But the verbosity in the configuration leads to mere frustration.
Spring Boot in the resuce..
1.Spring_Boot01
As a kid i used to love this show.one of my favourite disney show “Resuce Rangers”. okay i am not mad, just a developer like you.okay i mentioned about the Rescue Rangers because all of a sudden the line strikes me “Spring Boot in the rescue”.
okay lets get this straight.
what is Spring Boot?
It offers entirely a new style of developing spring based applications with minimal configuration.So, you don’t have to spend time for writing the configurations. Moreover it
simplifies the dependencies management with a more opinionated started POM .
These are some of the features (that i have taken from spring.io official Spring Boot documentation page)

Features:–

1)Absolutely no code generation and no requirement for XML configuration.
2)Spring Boot Starter dependencies:-Simplifies the dependency management with the starter POM .You inform Spring what all dependencies you need and it will make
                                                      sure all are added to the classpath.
3)Embed Tomcat,Jetty or undertow directly.
     So, you can run your web application as a standalone jar file which when runs starts the embedded server.You don’t need to follow
     the traditional style of making the war and deploy. Of course you always have the provision to deploy as a war file. But this way the
     deployment will be quite easy.
4)Automatic Configuration:-Automatically configure Spring wherever possible.
Keeping all the above points in mind we will develop a basic spring boot application. There are several ways we can develop the application. My favorite approach will be
to use STS and create Spring Starter project.
open STS
Go to File–>New–>Spring Starter Project
Spring_Boot1
1.Spring_Boot2
1.Spring_Boot3
1.Spring_Boot4
1.Spring_Boot5
We will dissect about the project structure. Anyway it is quite obvious from the structure as it is a maven project too. So , when we create a Spring boot application it create a class with the name of the application which acts as the entry point of the project and it bootstraps  spring boot. In the above project “DemoApplication” class is the main class .It looks like :-

The @SpringBootApplication annotation tells that this class is the entry point and when this class is loaded it leverages all the spring boot features.

Related Post

2 Comments

  1. YogarajKV

    Hey, Deepak Kumar,
    Can you post article about how internally spring boot application works? As far I know, Whatever jars available in the classpath based on spring boot will create dependency and it’s configuration. What I expect more on Starter pom.

    Reply
    1. Deepak Kumar (Post author)

      Hi Yogaraj,
      This was just a base on how to start writing the spring boot application. Probably in the next spring boot post i will try to cover whatever you mentioned. Till then keep watching for new posts.

      Thanks,
      Deepak

      Reply

Leave a Comment

Your email address will not be published. Required fields are marked *

Menu Title