Convention over configuration

Convention over configuration (English convention over configuration or coding by convention) is a software design paradigm which aims to reduce the complexity of configurations: as long as keep the developers in all areas of a software to usual conventions ( for example, the same type identifier ), these must not be configured, thus greatly simplifying the configurations without compromising the ability of developers. Thus, the paradigm supports the principles of KISS and Do not repeat yourself.

When using this approach, developers only need to configure more application-specific and unconventional aspects of an application. Other aspects such as the connection of input elements on the professional models to database tables can be assured by conventions such as the similar naming of classes and tables, and only need to be configured when departing from the conventions. Said, for example, the convention that a class of models in the singular and the associated database table to be named in the plural, so the developer must make any explicit configuration for a program with the model class Sale the sales table used. Does the table but about products_sold, he needs to configure this.

Objectives

Many traditional frameworks needed a set of configuration files to make project-specific settings. These settings affected not only global values ​​, but also repetitive for many elements of the application values ​​such as assigning classes to database tables. With the size and complexity of an application, the size and complexity increased these configuration files, which in turn reduced the maintainability of the application. The use of annotations instead of configuration files does not reduce this problem, but it moves only.

Convention over configuration reduces this very often structurally repetitive entries in configuration files and annotations. So the developers have to learn the behind a framework convention and not have to deal with a plethora of configurations only. Thus the maintainability of the application can be increased, thus reducing the overall cost of software development and maintenance.

Use

Convention over configuration has already been used long before the term became popular. An early example is the implicit variable declaration of Fortran. The JavaBeans specification also relies heavily on it. A number of modern frameworks use the paradigm to simplify their configurations. These include, among others, the frameworks Spring, Ruby on Rails, Grails, Zend Framework, CakePHP and Symfony and younger build tools such as Apache Maven and Gradle.

Related principles

  • Do not repeat yourself - to a convention over configuration matching principle of software development
  • KISS principle - another convention to fitting over configuration principle of software development
485384
de