[ASP.NET]3-Tier Arichitecture in ASP.NET

摘要:[ASP.NET]3-Tier Arichitecture in ASP.NET

看了幾篇有關ASP.NET 3-tier 的文章,以往我們都把連接資料庫的Code寫在後置程式裡或是用sqldatasource小精靈,

此作法是2-tier Client-Server的老舊架構.Net 1.1 old Wine in New Bottle,而3-tier的架構是現在.Net 4.0架構應該學習如何將程式分層

Advantages of a Three-Tier Architecture

A Client-Server architecture is a 2-Tier architecture because the client does not distinguish between Presentation Layer and Business Layer. The increasing demands on GUI controls caused difficulty in managing the mixture of source code from a GUI and the Business Logic (Spaghetti Code). Further, the Client Server Architecture does not support enough the Change Management. Let us suppose that the government increases the Entertainment tax rate from 4% to 8 %, then in the Client-Server case, we need to send an update to each client and they must update synchronously on a specific time otherwise we may store invalid or incorrect information. The Client-Server Architecture is also a burden to network traffic and resources. Let us assume that about five hundred clients are working on a data server. Then we will have five hundred ODBC connections and several ruffian record sets, that must be transported from the server to the clients (because the Business Layer remains in the client side). The fact that Client-Server does not have any caching facilities like in ASP.NET causes additional traffic in the network. Normally, a server has better hardware than the client, therefore it is able to compute algorithms faster than a client, so this fact is also an additional argument in favor of the 3-Tier Architecture. This categorization of the application makes the function more reusable easily and it becomes too easy to find the functions that have been written previously. If a programmer wants to make further updates in the application then he can easily understand the previous written code and can update it easily.

文章說出優點

1. 隨著UI Code增長,逐漸難管理Code

2. 集中管理的好處

3. ODBC連線數減少

參考文章 : 

http://www.c-sharpcorner.com/UploadFile/4d9083/create-and-implement-3-tier-architecture-in-Asp-Net/

http://www.c-sharpcorner.com/uploadfile/bf6d89/ado-net-evolution-part-i-2-tier-to-3-tier/

http://www.c-sharpcorner.com/uploadfile/bf6d89/ado-net-evolution-part-ii-2-tier-to-3-tier/