Throughout my career, I’ve been a guest speaker and judge at local universities. I’ve also interviewed many job seekers over the past several years. As a result, I’ve noticed some areas of weakness new developers have when being thrown out into the “real world” of programming. You’d be amazed at how many new programmers do not have experience with n-Tier architected applications.
So what is n-Tier architecture? N-Tier architecture refers to an architecture which breaks up an application into separate layers (tiers). A tier encapsulates methods, objects, properties, interfaces, technologies, etc to perform a set of predefined tasks. Each tier is separate and thus can reside on other servers, networks, assemblies, namespaces, classes, etc.
For an example, let’s say we have a Silverlight application. The Silverlight XAP is the presentation layer. Our Silverlight application then consumes a web service which creates objects which run queries on our SQL Server. The web service creates the business objects which are part of our business logic layer. The objects then query the database through the data access layer.
There are many advantages to breaking up the application into tiers (layers) like this:
1) Avoid changing or recompiling other layers if one layer needs changed.
2) Reduction of complexity.
3) Promotes parallel development
4) Easier to maintain.
5) Works much better with automated testing.
6) Easier to scale.
7) Promotes code/tier reuse.
8) Helps with adoption of new technologies.
In our Silverlight example, we had the presentation tier implemented using Silverlight on the client’s web browser. The web service, objects, and database interaction were done on the server. Because these layers were “distributed” among multiple machines, they can be referred to as “physical” layers. On the other hand, layers separated by assemblies or sets of classes can be thought of as “logical” layers.
Now that we know the basics as to what an n-Tier architected application is, in my next article I will show you how to create an n-Tier enabled ASP.NET web application using logical layers in Visual Studio 2010.
n-Tier Architecture – Part 1
n-Tier Architecture – Part 2