Question

Lets say I have a simple web application built in C#, which includes a few aspx pages and a web.config file that includes SQL Server database details. Some of the aspx pages will call stored procedures from the database - either SELECT or INSERT queries, and forms authentication will be used.

From an Application Architecture point of view, would this be 2-Tier Architecture (Data Tier - Client Tier) or 3-Tier architecture (Client Layer - Business Layer - Data Layer) ?

It sounds to me like 2-Tier, but since aspx.cs is server side, would this be seen as the business layer?

Also, apologies if I shouldn't be asking this question here, but I can't remember the name of your sister site!

Was it helpful?

Solution

Yes, in my opinion what you described is a 2-tier architecture because there is not a business layer even though the code is server-side. A business layer should contain all of your business objects and logic and your .cs pages would simply call those business objects.

I build most of my applications the same way: Asp.net front end calling SQL Server stored procedures for CRUD operations. However if I ever went to a different database platform I would have to change A LOT of code because there is not a true business layer in place. Lastly, a business layer will make your code more testable as well.

Sorry I can't help with the sister site question :)

OTHER TIPS

The terms Tier and Layer are not synonymous.

A Tier is a "physical" separation in the application. Each tier is a place where one or more layers are deployed and executed from. This includes items such as a web server, database server, etc. Note that the entirety of a 2 (or 20!) tier system may even be executed from a single machine. For example, when the web server and database server are installed on the same hardware.

A Layer is a logical separation in the application and uses terms such as Presentation, Business Logic and Data Access to describe the various logical separations made in your app.

Systems can be n-Tier and n-Layer.

So, if you have a web application made up of 1 web server (running the app itself) and 1 database server (your DB server) then you have a 2-Tier application. If the only separation in the application is where the table structures live, then it is most likely a 2 Layer application as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top