A quick overview of Spring Boot

Raja shekhar
3 min readApr 12, 2020

We already have a framework called Spring. So why Spring Boot?

What features will the spring boot provide? Does the spring boot reduce any Business logic? Does the Spring Boot add any value add-ons to the developer (benefit for developer )? like this, we have multiple questions.

Now I am going to clear one by one.

Like an overview, we will discuss a few things about the spring framework. For suppose if we want to develop the project by using the spring framework, what steps we should follow will discuss first.

First, we should add all the dependencies and respective transitive dependencies to the project (in pom.xml). We have to configure framework-specific configurations like configuration DataSource, handlers and view resolvers, etc. If the developer wants to test any changes we have rebuilt and deploy on the server even though it’s a small change. If the application moved to production, then the support team will be adding some more endpoints like monitoring and health check endpoints. The developer wants to build POC’s (sample snippets like generating Jasper reports) again developer will build a separate project. The above-mentioned steps we should follow for every application build by the spring framework.

Spring Boot features:

Starter Dependencies, Auto configurations, Dev tools, Actuators, Spring Boot CLI.

How these features will go to address the problems with spring?

Starter Dependencies: To maintain dependencies on our application Spring Boot came up with Starter dependencies. For every module, spring boot has provided dependencies. Just we need to add those dependencies to pom.xml then the dependencies of an application, associates transitive dependencies and other libraries will take care of starter dependencies. No need to worry about transitive dependency versions and compatibility issues with libraries. It will reduce a lot of time for the developer. It reduces the development cost of setting up things.

Auto Configurations: In the spring we have to configure framework-specific configurations as well as user-specific (user requirement) configuration. Even though we don’t have any requirement to configure additional configuration. To work with spring we have to configure additionally those are Data source, handler mappings, and view resolvers, etc. The following snippet will represent Datasource configurations in spring.

@Bean
public DataSource dataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName(“<driver class name>”);
dataSource.setUrl(“<url>”);
dataSource.setUsername(“<user name>”);
dataSource.setPassword(“<password>”);
return dataSource;
}

Spring boot provides one auto-configuration class for every class in the spring, for example, Datasource configuration, it has provided one Auto configuration class to load data source while application deployment. The Autoconfiguration classes will be loaded based on condition (like we have classpath, class level, and attribute level conditions). Spring Boot people will load DataSource based on the configurations like driver class name, URL, username, and password. Those details they exposed to application.properties file and based on the configurations spring boot will create Data source instance like this now developer no need to configure framework-specific configuration. Spring boot auto-configuration will take about this configuration

Dev Tools: If we made any change, then no need to rebuild and deploying things. Just we need to dev tools dependency to pom.xml and the server restarts will take care of the dev tools. This will save a lot of time to the programmer. Increase the productivity of the programmer.

Actuators: Now support team no need to add any additional configuration and endpoints to the application. In spring boot just we add Actuator dependency to pom.xml and everything takes care of spring boot. That way spring boot will make it easy to create production-grade Spring-based applications.

Spring Boot CLI: Now no need to create any new project for testing or writing Sample snippets. Just we have created one test file with a snippet of code, everything will be handled by Spring boot CLI. No need to import packages, No need to create classes, etc.

Spring Boot won’t reduce any code/Business logic. Just it will provide quick way configurations. Spring boot will save a lot of time. It will create a quick and production-ready application.

--

--