Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the contract greater than the configuration?

Shulou Source: shulou.com Published: 2022-06-03 07:34:02 09月19日 Update

This article introduces the relevant knowledge of "what is the agreement is greater than the configuration". In the operation of the actual case, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

A pact?

Convention is greater than configuration

The first time I heard this statement was when I was learning springboot. At the beginning, I only knew that it existed in the world of programs, and I didn't delve into its meaning.

A pact?

For us, a convention that meets the habits of most people is a good convention, while in a program, a convention that simplifies the implementation of the code and makes the code highly available is a good convention.

Convention is greater than configuration

In fact, the idea of "convention is greater than configuration" is used everywhere in development.

That is, in development, if you do not configure some values, the program will take a default value, in other words, the configuration that can take the default value, there is no need to configure, this default value is the convention.

Conventions can reduce a lot of configurations.

For example, in the structure of maven:

/ src/main/java directory is used to store java source files

The src/main/resources directory is used to store resource files, such as application.yml files, mybatis * mapper.xml files

The / src/test/java directory is used to store java test files

The / src/test/resources directory is used to store test resource files

The / target directory is the output location of the project

Java Project www.fhadmin.org

In fact, maven has done a lot of things for you, but it is hidden from users. You just need to follow its conventions.

Convention over configuration is a simple concept. Systems, class libraries, and frameworks assume reasonable default values, rather than requiring unnecessary configuration. In most cases, using the default values provided by the framework will make the project run faster.

In springboot, as long as you import web-stater,spring mvc, json, spring core containers and other web scenarios, all dependencies will be imported, and the version will be controlled.

The idea of spring boot is that the contract is greater than the configuration. A set of default configuration is provided in spring boot. There is no need to write the xml configuration file manually. Only when the default configuration does not meet our needs, the configuration will be modified.

This is the end of the content of "what is the convention is greater than the configuration". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Conventions configurations files that is directories programs projects code content just situations more frameworks knowledge statements resources learning development testing output Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology MySQL vpn Linux Shulou Tech Info