Header Ads

n-tier architecture

What is n-tier architecture?

N-Tier architecture refers to the architecture of an application that has at least 3 “logical” layers — or parts — that are separate. Each layer interacts with only the layer directly below, and has specific function that it is responsible for.

Why use n-Tier architecture?

Because each layer can be located on physically different servers with only minor code changes, hence they scale out and handle more server load. Also, what each layer does internally is completely hidden to other layers and this makes it possible to change or update one layer without recompiling or modifying other layers.

Typically, the user interface runs on a desktop PC or workstation and uses a standard graphical user interface, functional process logic may consist of one or more separate modules running on a workstation or application server, and anRDBMS on a database server or mainframe contains the computer data storage logic. The middle tier may be multi-tiered itself (in which case the overall architecture is called an “n-tier architecture”).

For Example:
A change of operating system in the presentation tier would only affect the user interface code.

Graphical Representation:

User Interface/Presentation Tier

Presentation tier has a class library which provides classes for creating reusable GUI components. The GUI components interface the business components.
Presentation Tier implements automated data workflows for GUI initialization, loading, saving data, enabling and disabling forms.
On this tier Multi-language support is implemented which allows runtime modification of terms and phrases. Application layer has class library which allows combining different reusable GUI components from User Interface tier into end products.

Data Tier

Data tier has Data Access class library which provides methods for exchanging data between business components and databases. Data tier has also designer tool which generates data entities and business components from database tables.

Business Tier

Business tier contains a class library which implements business functions. Business tier assures process authentication that prevents unauthorized usage of business components.

Service Tier

Service tier contains a class library which takes care of set-up and control Web Services, Remote objects, Windows Services and batch applications.

Workflow engine
Workflows are not set in the application code like in most software packages. Business flow diagram and control logic, defined by Business managers, is configured for workflow engine by using the user-friendly interface – Workflow designer with integrated version control. In fact it is possible to create multiple Workflows for any business context. Different workflows can be linked to any business context if necessary.
Comparison with the MVC architecture:

At first glance, the n- tiers may seem similar to the MVC (Model View Controller) concept. however, topologically they are different.

A fundamental rule in a n-tier architecture is the client tier never communicates directly with the data tier. In a n-tier model all communication must pass through the middleware tier. Conceptually the n-tier architecture is linear.

However, the MVC architecture is triangular. The View sends updates to the Controller, the Controller updates the Model, and the View gets updated directly from the Model. (refere figure 2)

Graphical Example of N-tier Architecture Web Development Usage in Microsoft which is self explanatory.

No comments:

Powered by Blogger.