title: Is it advisable to make a web program to interface to a database-agnostic layer?
body: <p>I'm a Winforms programmer before; I always partition programs I write in two parts, the front-end(Winforms) and middle-tier(facilitated by Remoting/WCF)</p>
  
  <p>On that approach, the front-end code cannot access the Linq or System.Data.SqlClient. But that has the added advantage that the middle-tier is an instant SOA-citizen (service oriented architecture), can be used in B2B scenarios, database-agnostic, and internet-capable even it's just a Winforms app.</p>
  
  <p>Now I'm learning web skills. Using the SportsStore project from the book Pro ASP.NET MVC, it's inevitable that I would compare my old(?) approach (the middle-tier) and the repository approach on that book. The repository approach exposes the data access mechanism(Linq to SQL) directly on front-end(SportsStore.WubUI).  Using the repository approach, the SportsStore.WebUI still has a direct connection to database.</p>
  
  <p>Question is, on web programs, should I aspire making the front-end to interface only to a middle-tier(so the front-end can be database-agnostic and the middle-tier is an instant SOA-citizen), or should I use the database directly(by means of repository approach, ORM, or similar) on front-end?</p>