2

Is it possible to use n-tier such as business entity, business logic, data access in ASP.NET MVC? Is it efficient to use n-tier in MVC?

Chris Fulstow
  • 41,170
  • 10
  • 86
  • 110
vantian
  • 848
  • 3
  • 10
  • 25
  • Yes it's possible, however unless your business scenario demands it, I wouldn't call n-tier efficient. I'd definitely not recommend it as your first step into MVC. – Ryan Nov 24 '11 at 07:13
  • yes.. MVC internally divided in tier UI and BI( Business intelligence - controls).. check this according to architecture [Architecture Guide: ASP.NET MVC Framework + N-tier + Entity Framework and Many More](http://www.codeproject.com/KB/aspnet/ASP_NET_MVC_WITH_EF.aspx) – Niranjan Singh Nov 24 '11 at 10:04

2 Answers2

2

Yes, ASP.NET MVC lends itself quite naturally to creating tiered architectures. Presentation and UI logic implemented by views and view-models can be connected by controllers to business logic and entities below, which in turn can be serviced by a data layer.

Chris Fulstow
  • 41,170
  • 10
  • 86
  • 110
0

n-tier is technically 3 or more tiers. Based on best patterns and practices, you can see projects like "Silk" that contain multiple projects in the solution. You can leverage a WCF project that you consume soap objects or restful resources within mvc. Whether you use Entity Framework or not, I suggest a repository pattern and keep business logic out of the repositories.

Keep logic out of controllers, repositories and have a SOC (separation of concerns). Try to look into the SOLID principle. This is where you can start to break things down into manageable and maintainable pieces of code.

Tom Stickel
  • 19,633
  • 6
  • 111
  • 113