Getting to Know About Spring Boot
What is Spring Boot ?
Spring Boot is an open source Java-based framework for developing microservices. Spring Boot makes it simple to develop stand-alone, production-grade Spring-based applications that can be “simply run.”
History
Rod Johnson, a developer, came up with the concept of Spring in 2002.In June 2003, the framework was distributed under the Apache 2.0 license for the first time.
Dependency Injection
Dependency Injection refers to an object’s ability to supply dependencies for another object.
Types of Dependency Injection
- Constructor Injection:
The injector provides dependencies through the client class constructor in this form of injection. - Setter Injection / Property Injection:
The injector method injects the dependency to the setter method accessible by the client in this form of injection. - Interface Injection:
The injector utilizes Interface to offer dependencies to the client class in this form of injection. Clients must implement an interface with a setter method that accepts the dependence.
Spring Boot Annotations
Indicates that a repository, which is a data access and storage abstraction, is an annotated class.
This class is a web controller, which means it can handle requests.
Maps an HTTP request to a controller method’s path.
Spring dependency injection will autowire a constructor, field, or setter method.
Indicates that a class has been annotated as a service class.
Advantages of Spring Boot
- Spring-based applications are simple to create in Java or Groovy.
- It saves a lot of time during development and boosts productivity.
- It saves time by eliminating the need to write a lot of boilerplate code, annotations, and XML configuration
Disadvantages of Spring Boot
- To modify and troubleshoot it, you’ll need to understand a lot of the underlying Spring systems (and a little Spring history), as well as some advanced topics.
- It is not recommended to start with Spring Boot if you have never worked with Spring before and want to learn about proxies, dependency injection, and AOP programming. Spring Boot does not cover most of these details.