Spring boot 遵循“Opinionated Defaults Configuration"方法是什么意思? [英] What is meant by Spring boot follows “Opinionated Defaults Configuration” Approach?

查看:38
本文介绍了Spring boot 遵循“Opinionated Defaults Configuration"方法是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始学习 spring boot .在其官方页面中,我发现了这个术语,但我不明白它在 Spring 启动上下文中的实际含义.

I have just started learning spring boot . In its official page I found out this term and I did not understand that what actually it meant in Spring boot context.

推荐答案

Spring Boot 只是决定了一组默认配置的 bean,您可以根据需要覆盖它们.

Spring Boot just decides on a set of default configured beans which you can override if you want.

例如,如果您包含 jpa 的 spring boot starter pom,您将为您自动配置一个内存数据库、一个休眠实体管理器和一个简单的数据源.这是一个可以覆盖的自以为是(Spring 认为这是一个很好的起点)默认配置的示例.

For example if you include the spring boot starter pom for jpa, you'll get autoconfigured for you an in memory database, a hibernate entity manager, and a simple datasource. This is an example of an opinionated (Spring's opinion that it's a good starting point) default configuration that you can override.

参见 https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-replacing-auto-configuration

这篇关于Spring boot 遵循“Opinionated Defaults Configuration"方法是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆