Robert “Uncle Bob” Martin argues that an application’s purpose should determine its architecture; its delivery mechanism should not. If you look at an architectural drawing of a church, for example, you can tell it’s a church. But if you look at an architectural drawing of a web application, the fact that it’s a web application should not be the first thing you notice.
The web is a delivery mechanism. The web is a detail. The web is not particularly important to your application. … The web is a pipe. It is nothing more than a pipe. It is not the central abstraction of your application. It is not the grand, overarching thing that makes your application the application it is. The web is just a dumb detail. And yet it dominates our code.
From Robert Martin’s keynote at Ruby Midwest 2011. The quote starts about 9 minutes into the presentation.
He goes on to explain how to let the functionality of the application determine its architecture. In the dependency diagram arrows point from the delivery mechanism to the rest of the code, but none point the other way. By following this design you get something easier to test.