ASP.NET MVC: Convention over Configuration

August 17th, 2015

For those new to ASP.NET MVC, Microsoft took a "convention over configuration" approach when building MVC web applications. Today, I go over those conventions all of the ASP.NET MVC framework.

I would consider this a follow up to the previous post about the differences between WebForms and ASP.NET MVC. Most new MVC developers don't know about the conventions implemented in MVC. So I thought I'd take the time to talk about these conventions.

Convention over Configuration (or coding by convention) is a term that when a convention, or code pattern, is implemented by a tool to match the desired behavior, it behaves as expected without the use of any configuration files.

This makes your coding easier when you know the conventions of where everything is located and you place each component into it's correct location.

Here is a quick list of simple conventions implemented in ASP.NET MVC:

Controllers

Routes

Views

Content

Areas

Conclusion

I think I've covered most of the important conventions of an ASP.NET MVC application.

It's amazing the people who I've met who code ASP.NET MVC sites on a daily basis. We take for granted certain conventions while coding. It just becomes second-nature to them without even thinking.

This is what "in the zone" and "convention" means.

Did I miss a convention? Are you taking a convention for granted? Post your comments below.