Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the contract greater than the configuration?

2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report