Convention over configuration
Convention over configuration ( english convention over configuration or coding by convention ) is a Software Design - paradigm which aims to the complexity of configurations to reduce: As long as the developers in all areas of software to usual conventions (for example, similar identifier) hold, these do not have to be configured, which considerably simplifies the configurations without restricting the possibilities of the developer. The paradigm thus also supports the principles of KISS and Don't repeat yourself .
Using this approach, developers only need to configure application-specific and unconventional aspects of an application. Other aspects, such as the connection of input elements via the specialist models to database tables, can be ensured by conventions such as the same naming of the classes and tables and only need to be configured if the conventions are deviated from. For example, if the convention states that a model class should be named in the singular and the associated database table in the plural, the developer does not need to make any explicit configuration so that a program with the model class can use
sales. But if the table is called something
products_sold, he has to configure this.
Many traditional frameworks required a number of configuration files to make project-specific settings. These settings not only affected global values, but also repeated values for many elements of the application, such as the assignment of classes to database tables. With the size and complexity of an application, the size and complexity of these configuration files increased, which in turn reduced the maintainability of the application. Using annotations instead of configuration files does not reduce this problem, it only moves it.
Convention before configuration precisely reduces these often structurally repeated entries in configuration files and annotations. This means that the developers only need to learn the conventions behind a framework and not have to deal with a huge number of configurations. This increases the maintainability of the application and thus reduces the overall costs of software development and maintenance.
Convention over configuration was used long before the term became popular. An early example is Fortran's implicit variable declaration . The JavaBeans specification is also heavily based on it. A number of modern frameworks use the paradigm to simplify their configurations. These include the Spring , Ruby on Rails , Grails , Zend Framework , CakePHP , Laravel and Symfony frameworks as well as more recent build tools such as Apache Maven and Gradle .
- Don't repeat yourself - a principle of software development that fits convention before configuration
- KISS principle - another principle of software development that matches the convention before configuration
- Nicholas Chen: Convention over Configuration. November 29, 2006, accessed July 4, 2010 .