Last post Feb 26, 2010 02:50 AM by toas1
Feb 25, 2010 06:37 AM|bhaskar.joardar|LINK
I want to create a project in ASP.NET where I can implement 3-tier architecture. The server for UI,BAL and DAL should be different. But I don't know where to start. Can anyone provide me any
tutorial over that. The question is not about creating BAL,DAL and UI in a same project and putting the BAL,DAL files in different folders in app_code folder. I want to know how I will implement 3-tier architecture in a big real life projects.
If you can please provide me a sample project.
Thanks in advance.
Feb 25, 2010 09:18 AM|toas1|LINK
I dont really understand why you make a differnce off a "big real life project" and placing the code in app_code? IIS is already an excelent Application server that are more then capable to run all your logic (from data access to UI). Keep in mind that moving
data between your layers are always much faster if all your logic run in the same application domain.
Then, offcourse, there are times when you for some reason need to split it and run it on different servers. If this is what you need to do I suggest that you look in to WCF. Thats really all you need to setup communication between your layers. Just google
it and you will find tons off good reading like:
Feb 25, 2010 01:31 PM|Imran khan|LINK
Following is the step by step process.
1: first of all you add asp.net website.
2:Then right click on solution and add new project.now this time add class library.name it DAL for Data Access Layer to put the Data Base Processes classes.
3:Then right click on solution and add new project.now this time add class library.name it Entities or BAL for put the Entities or business process classes in this project.
4: now add the reference of 3 project to 2 and first.
5:add the reference of 2 into 3rd.
6:usually entities project have no raference of anyother project.
rebuild and use them.
Feb 25, 2010 02:27 PM|toas1|LINK
Following is the step by step process.
This is the way to do if you want to run everything on a single IIS server. If you, on the other hand, wants to split it up on different tiers (servers) you need to run your DAL and BAL (or whatever layers you need to separate to this tier) in a WCF service
(likely, but not a must) hosted on either IIS or WAS.
Feb 25, 2010 03:01 PM|hans_v|LINK
Also, take a look at the website of
Rockford Lhotka, where he talks about his CSLA.NET Framework.
Feb 25, 2010 03:22 PM|atconway|LINK
You are wanting advice on how to create a 3-tier physical structure; while splitting each logical layer out and placing on its own physical tier has a 'few' advantages, you need to be well aware of the disadvantages. For that, please read the following
link, and look at an excerpt from this link to see what I am eluding to:
"Crossing a boundary is expensive. It is on the order of 1000 times slower to make a call across a process boundary on the same machine than to make the same call within the same process. If the call is made across a network it is even slower. It is
very obvious then, that the more boundaries you have the slower your application will run, because each boundary has a geometric impact on performance."
Should all apps be n-tier?
With that being stated, I don;t really know of a 'tutorial' on setting up all the different servers for a distributed system like this. In some ways it is more of an infrastructure project than a software one. Once you have all the software consuming and
talking to all of the pieces, then it is a matter of getting them all spread out each on its own tier.
My advice, unless you have an application with some seriously heavy usage and need some real scalability in terms of performance, I would not venture down this route without knowing exactly what you are doing. If you heard about
a true n-tier physical design and though conceptually it sounded like a good idea, and wanted to implement it, make sure you understand the downsides of it 1st.
Hope this helps!
Feb 26, 2010 02:50 AM|toas1|LINK
unless you have an application with some seriously heavy usage and need some real scalability in terms of performance,
Just a thought here, I faced this problem a while a go when I was about to set the design for all our customer sites. We have about 100 different sites that we build and host for our customers. All these sites share the same data but the presententation
is way different. The first thought was to separate the data access into its own physical tier serving all front end web servers with data. This would allow us to cache data down in the "data tier". After some redisign we decided to not split into a separate
tier but run all layers on IIS and use the memcached server as a separe cache server serving all web servers with cahced data. A very sucessfull soultion!