Spring Boot

By now, you have been using Spring Boot to create the backend of Messages App along the way. As you can see, using Spring Boot to create a web application is quite straightforward. Now, let's take a closer look at it to see how it boosts developer's productivity.

Spring Boot takes an opinionated view of building production-ready applications. Its opinion is mostly expressed through its starters and its autoconfiguration mechanism. And, because of that, most Spring Boot applications need much less Spring configuration than traditional Spring applications.

A Spring Boot application typically inherits from the spring-boot-starter-parent project, which provides Maven defaults and a dependency management section so that you don't need to specify the version of those dependencies that Spring Boot supports. All you need to do is to specify Spring Boot version. On the other hand, you can still specify a version and override Spring Boot's recommendation.

If you're interested in the dependencies that Spring Boot supports by default, you can go to the https://github.com/spring-projects/spring-boot and check the spring-boot-project/spring-boot-dependencies/pom.xml file.

Also, Spring Boot supports a variety of technologies that can be used to build almost anything. To get started with a specific technology, all you need to do is simply add the starter that supports such a technology to your dependencies, and Spring Boot will take care of the initialization of the beans you need. For example, in our Messages App, we need to use JDBC, so we add the spring-boot-starter-jdbc starter and Spring Boot will create the DataSource bean by using the data source parameters we defined in application.properties.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.213.238