« WPF/E Now Includes a Downloader Feature | Main | Video: Creating a Web Service with Windows Communication Foundation (WCF) »

Video: Creating an N-Layer ASP.NET Application

In this video tutorial I walk through the fundamentals of creating an N-Layer ASP.NET application. What's "N-Layer" you ask? N-Layer can be interpreted many different ways, but I generally use the term to mean separating presentation, business and data code into individual layers. Doing this allows code to be re-used throughout an application and prevents unnecessary clutter in ASP.NET code-behind classes. This video covers creating presentation, business and data layers and also covers another layer I normally add to projects that I refer to as "Model". The model layer contains data entity classes that are used to pass data between the different layers.

If you're currently embedding all of your code directly in ASP.NET pages, this video will help get you started on the road to recovery. I'm kidding of course, but if you want to build more re-useable and maintainable applications you'll want to segregate your code into different layers at a minimum. Other types of architectures can certainly be applied as well. The code shown in the video can be downloaded here.

 

Posted on Monday, February 5, 2007 at 10:08PM by Registered CommenterDan Wahlin in , | Comments4 Comments | References2 References

PrintView Printer Friendly Version

EmailEmail Article to Friend

References (2)

References allow you to track sources for this article, as well as articles that were written in response to this article.

Reader Comments (4)

This is good one!
February 16, 2007 | Unregistered CommenterChand Basha
That was really helpful....Thanks.
February 27, 2007 | Unregistered CommenterDT
hi Dan,


A guy name Mike raised the question of:

Why bother with an array, wouldn't it be better to just pass the generic list?

and you reply was:

For the List<Model.Customer>, that would be fine to return of course, but I prefer to keep the overhead of objects passed between the layers as minimal as possible. Just a personal choice. If I knew the collection would have to be increased potentially then I'd pass the List<Model.Customer>.

my question is:

does it safe to pass class around the n-tire? or is it consider to be overhead and if thats overhead then what is the better way or best practice to be use?

how do you pass generic List<Model.Customer>? can you show me few lines of code please?

thanks.
July 12, 2007 | Unregistered Commenternisarkhan
A Very good video,very helpful to me. I just want to ask one thing that what is the need to making an array and sending to presentation layer,why don't directly send dataset from DAL.How it improve performance of the application,why we usually choose array,we can chose dataset and send multiple tables in single call to DAL?
July 23, 2007 | Unregistered Commenterpardeep
Editor Permission Required
You must have editing permission for this entry in order to post comments.