Spring Boot is the extension of Spring framework including all the features of Spring. Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can just run. Spring Boot is becoming favorite of developers nowadays, 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 in very less time.
It is mostly used to create Micro-Services.
1. Why Spring Boot is evolved?
2. Goals of Spring Boot
Spring Boot is designed with the following goals −
- To avoid complex XML configuration in Spring
- To develop production-ready Spring applications in an easier way
- To reduce the development time and run the application independently
- Offer an easier way of getting started with the application
3. Features of Spring Boot
You can choose Spring Boot because of the features and benefits it offers as given here −
-
It provides a flexible way to configure Java Beans, XML configurations, and Database Transactions.
-
It provides powerful batch processing and manages REST endpoints.
-
In Spring Boot, everything is auto-configured; no manual configurations are needed.
-
It offers an annotation-based spring application
-
Eases dependency management
-
It includes Embedded Servlet Container
4. Advantages of Spring Boot
- Easy to understand and develop applications
- Increases productivity
- Reduces the development time
- Simplified & version conflict-free dependency management through the starter POMs.
- Spring Boot provides HTTP endpoints to access application internals like detailed metrics, application inner working, health status, etc.
- No XML based configurations at all. Very much simplified properties. The beans are initialized, configured, and wired automatically.
- The Spring Initializer provides a project generator to make you productive with the certain technology stack from the beginning. You can create a skeleton project with web, data access (relational and NoSQL datastores), cloud, or messaging support.
5. Spring Boot Disadvantages
- Spring boot may unnecessarily increase the deployment binary size with unused dependencies.
- If you are a control freak, I doubt Spring Boot would fit your needs.
- Spring Boot sticks well with microservices. The Spring Boot artifacts can be deployed directly into Docker containers. In large and monolithic based applications, I would not encourage you to use Spring Boot.
6. Components of Spring Boot
The whole application logic revolves around its components. There are three main components of Spring Boot :
-
Controller
It is responsible to handle user request and return appropriate response. -
Service
Here we implement the business logic of the application -
Repository
Here we write the logics to perform datbase transaction on data ( save, updadate and retrieve)
7. Prerequisites to get started with Spring Boot
The only prerequisite for learning any java based framework is Java itself. So before getting started with the Spring Boot, you must have strong knowledge on:-I. Core Java
Concepts related to
- OOP Concepts,
- Method overloading
- Method overriding
- Abstract class
- Interface
- Collections
- Exceptions
II. J2EE
You must have a little bit of knowledge of J2EE related technologies like:-
- Servlet
- JSP
- JDBC
- Web-technologies (HTML, CSS, Javascript)
And additionally some design patterns like
Strategy, Singleton, Factory and MVC architecture
Learn at least how to write a Servlet program and how to configure the servlet. Must have knowledge on how to connect the database using JDBC and at least know simple CRUD operations, must have knowledge on one database.
For more deep knowledge and for cracking interviews you may learn about spring modules like:-
- Spring Core
- Spring MVC
- Spring Data etc etc
As Spring Boot is built on top of Spring framework, for working into Spring boot you don't need to know all of these modules. This would also take a lot of time. So start from Spring core and then jump into others according to your interest.
Then it will be very interesting to learn spring boot.
For setting up a project you need to set a directory structure, properties file, build file with dependencies, testing codes and many more things required before getting started for actual coding. But do not worry about this? we have Spring Initializr to do the same, only you need just 5 min to understand it forever, click next to go to Spring Intializr.