Getting to Know About Spring Boot

HIRUSHA
2 min readJun 7, 2021
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

  1. Constructor Injection:
    The injector provides dependencies through the client class constructor in this form of injection.
  2. Setter Injection / Property Injection:
    The injector method injects the dependency to the setter method accessible by the client in this form of injection.
  3. 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

@Repository

Indicates that a repository, which is a data access and storage abstraction, is an annotated class.

@Controller

This class is a web controller, which means it can handle requests.

@RequestMapping

Maps an HTTP request to a controller method’s path.

@Autowired

Spring dependency injection will autowire a constructor, field, or setter method.

@Service

Indicates that a class has been annotated as a service class.

Annotations of Spring Boot

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.

--

--