Saturday, December 25, 2010

Convention over configuration / Coding by convention

Convention over configuration, also known as coding by convention, is a software development principle with the goal to reduce the number of decisions that developers need to make. The way to do this is to use a set of conventions in the component, where the developer only needs to specify any unconventional aspects. For example, in an object relational mapping framework (ORM) this could imply that when a class is named Contact in the code, the ORM framework would assume the corresponding table in the database would also be named Contact. If this is not the case, then it must be configured.

The great benefits of this principle are ease of use and smaller configuration files as the developers don't have to configure or know all the details of the component.