官术网_书友最值得收藏!

Spring Boot for building RESTful microservices

Spring Boot is a utility framework from the Spring team for bootstrapping Spring-based applications and microservices quickly and easily. The framework uses an opinionated approach over configurations for decision making, thereby reducing the effort required on writing a lot of boilerplate code and configurations. Using the 80-20 principle, developers should be able to kick start a variety of Spring applications with many default values. Spring Boot further presents opportunities to the developers for customizing applications by overriding auto-configured values.

Spring Boot not only increases the speed of development, but also provides a set of production-ready ops features such as health checks and metrics collections. Since Spring Boot masks many configuration parameters and abstracts many lower level implementations, it minimizes the chances of errors to a certain extent. Spring Boot recognizes the nature of the application based on the libraries available in the classpath, and runs the auto-configuration classes packaged in those libraries.

Often, many developers mistakenly see Spring Boot as a code generator, but, in reality, it is not. Spring Boot only auto-configures build files, for example, pom files in the case of Maven. It also sets properties, such as data source properties, based on certain opinionated defaults.

Consider the following dependencies in the file pom.xml:

    <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>runtime</scope>
</dependency>

For instance, in the preceding case, Spring Boot understands that the project is set to use the Spring Data JPA and HSQL database. It automatically configures the driver class and other connection parameters.

One of the great outcomes of Spring Boot is that it almost eliminates the need to have traditional XML configurations. Spring Boot also enables microservices development by packaging all the required runtime dependencies into a fat executable jar.

主站蜘蛛池模板: 祥云县| 依安县| 南漳县| 吴旗县| 平阴县| 云阳县| 阿拉尔市| 汝阳县| 马鞍山市| 青川县| 浙江省| 洪湖市| 荣昌县| 安乡县| 屏东县| 息烽县| 雅安市| 遂川县| 宁河县| 犍为县| 龙江县| 桑植县| 肃北| 策勒县| 自治县| 施秉县| 土默特左旗| 白水县| 克什克腾旗| 诏安县| 江安县| 兰州市| 香格里拉县| 康乐县| 宿迁市| 仲巴县| 阳江市| 隆林| 荔波县| 梓潼县| 将乐县|