Codacoda
Back to Academy

coding principles

Convention Over Configuration

Convention Over Configuration (CoC) is a design paradigm that decreases the number of decisions developers need to make by providing sensible defaults. The framework or system assumes reasonable conventions (file locations, naming patterns, default behaviors) so that explicit configuration is only required when deviating from the norm. This reduces boilerplate, speeds up development, and makes projects more consistent and easier for new developers to understand.

Use Cases

  • Framework routing that maps URL paths to controller files automatically based on directory structure
  • ORM tools that infer table names from class names and column names from field names
  • Build tools that look for source files in conventional directories (src/, test/) without configuration
  • Dependency injection frameworks that auto-wire beans by type when there is only one candidate

Visualization

BEFOREApplicationbootstrap()routes.xml50+ route mappingsorm-mapping.xmltable → class mapsservices.xmlDI bindingsdeploy.xmlenv config
Speed:1x
The application requires four XML configuration files before it can even start. Every route, model, and service must be explicitly declared.Step 1 / 7

Implementation

Output

Click "Run Code" to see output...