Spring Boot Essentials

As you have seen so far, Spring boot takes care of a lot of the boiler plate configurations required to setup a Spring application that we would have to do otherwise and helps us to get to the application coding part asap.

To do that, Spring boot has 4 tricks up its sleeve that it uses to accomplish what it does.

They are

Advertisements

  1. Starter Dependencies
  2. Auto Configuration
  3. CLI
  4. Actuator

Lets look at them in little more depth

  1.   Starter Dependencies: Starters are a set of convenient dependency descriptors that you can include in your application. This is like a one stop shop for all Spring related technologies that you can use, with out finding and defining each and every dependency that is required for your application. For example, if you want to use a db back end for our application you just define spring-boot-starter-data-jpa to tell spring to load all jpa related dependencies automatically. Like wise for web applications just include spring-boot-starter-web and you are good to go.

2. Auto Configuration: Spring Boot also attempts to automatically  configure your spring application based on the jar dependencies defined in the application. For example if HSQLDB is defined in the classpath then Spring boot would auto-configure an in-memory database. This is enabled using @EnableAutoConfiguration annotation to one of the @Configuration annotated class.

3. CLI: Spring Boot CLI is command line tool that can be used if you want to quickly prototype with Spring. It allows you to run groovy scripts, which has a java like syntax without much boilerplate code. This is an optional component that provides tremendous power and simplicity for Spring development. It also introduces a rather unconventional development model.

4. Actuator: This provides production ready monitoring features for your application. This includes Auditing, health and metrics for your Spring boot application. Actuators generate a large amount of information from a small change, providing extensive data about the running application. Actuator HTTP endpoints are available only with Spring-MVC based application.

This summarizes the essentials of Spring Boot.

 

Advertisements

Leave a Reply

Your email address will not be published. Required fields are marked *