Spring Boot

Gita Gupta
4 min readJun 28, 2020

Spring Boot is built on the top of the spring and contains all the features of spring. Spring Boot is a Framework from “The Spring Team” to ease the bootstrapping and development of new Spring Applications.All in all, Spring Boot is a project built on the top of the Spring Framework. It is a Spring module that provides the RAD (Rapid Application Development) feature to the Spring Framework and is becoming favourite of developer’s these days because of it’s a rapid production-ready environment which enables the developers to directly focus on the logic instead of struggling with the configuration and set up. It provides a simpler and faster way to set up, configure, and run both simple and web-based applications. It is used to create a stand-alone Spring-based application that you can just run because it needs minimal Spring configuration.

In Simple Terminology, What Spring Boot means —

that means Spring Boot is nothing but existing Spring Framework + Some Embedded HTTP Servers (Tomcat/Jetty etc.) — XML or Annotations Configurations.
Here minus means we don’t need to write any XML Configuration and few Annotations only.

Why Spring Boot?

•To ease the Java-based applications Development, Unit Test and Integration Test Process.

•To reduce Development, Unit Test and Integration Test time by providing some defaults.

•To increase Productivity.

•The main goal of Spring Boot Framework is to reduce Development, Unit Test and Integration Test time and to ease the development of Production ready web applications very easily compared to existing Spring Framework, which really takes more time.

•To avoid XML Configuration completely

•To avoid defining more Annotation Configuration(It combined some existing Spring Framework Annotations to a simple and single Annotation)

•To avoid writing lots of import statements

•To provide some defaults to quick start new projects within no time.

•To provide Opinionated Development approach to reduce Developer effort

•To develop Spring Based applications very easily with Java or Groovy.

•To integrate Spring Boot Application with its Spring Ecosystem very easily like Spring JDBC, Spring ORM, Spring Data, Spring Security etc.

•To develop and test our web applications very easily as It provides Embedded HTTP servers like Tomcat, Jetty etc

•To develop and test Spring Boot(Java or Groovy) Applications from command prompt very easily and quickly as it provides CLI (Command Line Interface) tool.

•To develop and test Spring Boot Applications very easily using Build Tools like Maven and Gradle as it provides lots of plugins.

•To work with embedded and in-memory Databases very easily as it provides lots of plugins .

By providing or avoiding these things, Spring Boot Framework reduces Development time, Developer Effort and increases productivity.

Now let us see ,

How spring boot is different from Spring and Spring MVC and along with that we will be focussing on some of the features of Spring Boot?

Spring Boot is built on the top of the conventional spring framework. So, it provides all the features of spring and is yet easier to use than spring.

It allows to avoid heavy configuration of XML which is present in spring:
Unlike the Spring MVC Project, in spring boot everything is auto-configured. We just need to use proper configuration for utilizing a particular functionality.
For example: If we want to use hibernate(ORM) then we can just add @Table annotation above model/entity class and add @Column annotation to map it to table and columns in the database

It provides easy maintenance and creation of REST end points:
Creating a REST API is very easy in Spring Boot. Just the annotation @RestController and @RequestMapping(/endPoint) over the controller class does the work.

It includes embedded Tomcat-server:Unlike Spring MVC Project where we have to manually add and install the tomcat server, Spring Boot comes with an embedded Tomcat server, so that the applications can be hosted on it.

Deployment is very easy, war and jar file can be easily deployed in the tomcat server:
war or jar files can be directly deployed on the Tomcat Server and Spring Boot provides the facility to convert our project into war or jar files. Also, the instance of Tomcat can be run on the cloud as well.

Microservice Based Architecture:
Microservice, as the name suggests is the name given to a module/service which focuses on a single type of feature, exposing an API(application peripheral interface).Let us consider an example of a hospital management system.

–In case of monolithic systems, there will be a single code containing all the features which are very tough to maintain on a huge scale.

–But in the microservice-based system, each feature can be divided into smaller subsystems like service to handle patient registration, service to handle database management, service to handle billing etc.

  • Microservice based system can be easily migrated as only some services need to be altered which also makes debugging and deployment easy. Also, each service can be integrated and can be made in different technologies suited to them.

We can develop two flavors of Spring-Based Applications using Spring Boot

•Java-Based Applications

•Groovy Applications

To Start Opinionated Approach to create Spring Boot Applications, The Spring Team (The Pivotal Team) has provided the following three approaches:

•Using Spring Boot CLI Tool( to develop Spring Boot Groovy Applications)

•Using Spring STS IDE( to develop Spring Boot Groovy Applications)

•Using Spring Initializr Website(to develop Spring Boot Java Applications)

Spring Boot having innumerable advantages and benefits it too have some limitations.So,let us explore-

Disadvantages of Spring Boot

•Spring boot may include dependencies that are not used thereby causing huge deployment file size.

  • Turning legacy spring applications into Spring boot requires a lot of effort and a time-consuming process.

So, this was all about the basic and initial knowledge to get started with Spring boot.

--

--

Gita Gupta

A learner, a dreamer , and always enthusiastic to learn...