
上QQ阅读APP看书,第一时间看更新
Single Tier—Two Layer Model
In this type of solution, we will still have only one web project, but we will separate the UI code into one namespace, and the BL and DAL into another namespace.
ASP.NET Web Project that has two folders:
- Code: This folder will have class files containing business logic and data access code under a single namespace, say
MyApp.Code
- Web: This folder will have the user controls, ASPX pages, and other presentation-related code under the namespace, say
MyApp.Web
Here, as the business logic and data access code are logically separated from the presentation code, we have two layers. However, as all code files would still be compiling into assemblies under a single project's /bin
, we will have only one tier. We can use this model for projects that have little or no business logic but need to access a database for content.