What is the difference between layers and tiers
Layers refer to logical seperation of code. Logical layers help you organise your code better. For example an application can have the following layers.
1)Presentation Layer or UI Layer
2)Business Layer or Business Logic Layer
3)Data Access Layer or Data Layer
The aboove three layers reside in their own projects, may be 3 projects or even more. When we compile the projects we get the respective layer DLL. So we have 3 DLL's now.
Depending upon how we deploy our application, we may have 1 to 3 tiers. As we now have 3 DLL's, if we deploy all the DLL's on the same machine, then we have only 1 physical tier but 3 logical layers.
If we choose to deploy each DLL on a seperate machine, then we have 3 tiers and 3 layers.
So, Layers are a logical separation and Tiers are a physical separation. We can also say that, tiers are the physical deployment of layers.
Tiers:
1) Presenation Tier or UI Tier (Hosts the Presentation Layer or UI Layer). This can be considered as web server in case of an ASP.NET web application.
2) Application Tier or Business Tier (Hosts Business Layer or Business Logic Layer).
3) Data Access Tier or Data Tier (Hosts Data Access Layer or Data Layer).
4) Database Tier - SQL Server or Oracle (or any other database) which has tables, stored procedures and other database objects.
In general the following are the responsibilities of each layer or tier:
1)Presentation Layer or Tier is usually responsible for interacting with the user.
2)Business Layer or Tier is responsible for implementing the business logic of the application.
3)Data Access Layer or Tier is responsible for encapsulating the code that accesses the persistent data stores such as a relational database.
Subscribe to:
Post Comments (Atom)
Hello,
ReplyDeleteCould you please let me know the difference between 3-tier architecture and MVP pattern
Thanks,
P
A MVC architecture is seperated into Model - Responsible the the management of the data, View - Responsible for displaying data in a meaningful way and the controller - that is responsible for the control flow of the application recieving input and interacting appropriatlly with the other layers.
ReplyDeleteThe most notable difference is that the view (that may be compared to the presentation layer when coupled with the controller) may speak directly to the model (the data).
This would be a violation of an n-tier architecture. It is however possible to have a MVC architecture within a single tier of a 3-tier architecture. For example your presentation layer may be structured following an MVC architecture.
What are HTTP Modules and HTTP Handlers in ASP.NET?
ReplyDeleteHTTP modules and HTTP handlers are an integral part of the ASP.NET architecture. While a request is being processed, each request is processed by multiple HTTP modules (for example, the authentication module and the session module) and is then processed by a single HTTP handler. After the handler has processed the request, the request flows back through the HTTP modules.
DeleteVery Good article. The explanation is superb ! Keep them coming !
ReplyDeleteVery Good article. The explanation is superb ! Keep them coming !
DeleteHi can you please let me know how to deploy 3 different dll's into 3 diff. machines., and how does our app work under N Tier architecture..?
ReplyDeleteIn earlier technologies dll is different machines was accessed using DCom technologies. Now you can use WCF services to expose you class libraries(dll). Create a class library service and host it in console environment or in IIS and access that service in your presentation layer.
Deletenice and amazed
ReplyDeleteThe explanation is awesome! Keep them coming dude!
ReplyDeleteThis is a an amazing piece of explanation..... i m just so thankfull to u.
ReplyDeleteVery Good explanation.. thanks keep update us.
ReplyDeleteCan u please tell me wha t are table variables?
ReplyDeleteHi Krish, I have recorded a video and uploaded on youtube, that explains Derived tables, common table expressions, Views, Table Variable, Local and Global Temp Tables. Please watch Part 48 from SQL Server tutorial for beginners. I have included the link below.
DeleteSQL Server, ASP.NET and C# Video Tutorials
What is web application and web site ? Difference ?
ReplyDeletewhat is 3 Tier Arch. and N Tier Arch. ? Difference ?
Reply me on my mail id
rajkumar.asp.net@gmail.com
Thanks
I found the articles in this site very useful, thanks for sharing the knowledge --Rohini
ReplyDeleteCreate a MVC3 app like website with basic CRUD and movie listing. We would like to have the following entities in the application.
ReplyDeleteEntities
Actors
- Name
- Sex
- DOB
- Bio
Movies
- Name
- Year of release
- Plot
- Poster (image)
Producers
- Name
- Sex
- DOB
- Bio
Relationships
● Actor can act in multiple movies
● Movie can have multiple actors
● Movie has only one producer
● Producer can produce multiple movies
Application specifics
1. Screen to list all movies
2. Screen to ‘add’ a new movie with the necessary form elements and at the same time to allow to add ‘Actors’ and ‘Producers’ to the movie. (We want to see how you accomplish this task).
3. ‘Listing’ screen should allow user to click on a movie and view all the details of the movie.
4. ‘Listing’ screen should allow user to click on ‘Edit’ and edit all the details of the movie and save it.
5. ‘Listing’ screen should allow user to click on ‘Delete’; pop-up a confirm message (Yes/No) for the user and if the user clicks ‘Yes’ delete the movie from the Db.
6. Adding / Editing / Deleting a movie should take the user back to the ‘Listing’ screen with a notification message.
can u solve this and mail me: nknitin579@gmail.com
Hi,
ReplyDeleteIf we choose to deploy each DLL on a separate machine, then how each DLL will interact with each other?
Sir , please help me to understand N tier Architecture in detail, If you have a video reference , please point to that. Thanks in advance.
ReplyDelete