List of Articles

Understanding A Basic N Tier E-Commerce Site

I am sure you must have heard of "Ecommerce". And readers who have used an Ecommerce application (Rediff, Indiamarkets, Bazee) will readily accept that the Internet and its Ecommerce Revolution is not just hype but an environment which brings individuals and organisations together in newer and exciting ways.
Ecommerce applications are either in B2B, B2C segments. These Applications can also be classified as Mcommerce where the user uses a mobile phone to access Internet sites.
This article discusses tools and services to develop such applications.
In any application, complex or simple, we talk about the facilities or services which we are to be considered. Each service has a particular role in the application namely Database Services, User Interface Services, Mail Services, Print Services, Help Services etc.

Client Server Architecture

The 3-Tier client-server approach defines a way of dividing these application services into three distinct roles (Concerning presentation, business rules and data), which are arranged so that each can operate at the maximum efficiency.

Presentation Tier

The presentation tier is responsible for providing the services the application needs to allow the user to view and manipulate the application. Simply put it presents an easy interface to the user. In 2 Tier (Presentaion layer directly talks with database) it could be any of the common front ends namely Visual Basic, Powerbuider, Developer 2000 etc.. In a Web oriented application, the presentation tier will be of HTML. With HTML, we can create static web pages. Static pages means we can display information but it will not give us the features to make it interactive. Web Interactivity can be provided by the following tools namely Scripting Tools, Applets, WML script.

Scripting Language

Scripting language allows us to make interactive web pages. So for asking any information from user, validating the information on client side will be done by scripting language and HTML as a combination. VBscript and Javascript are two popular scripting languages. Making use of VBScript has a specific disadvantage that it becomes dependent on browser. All the browsers do not support VBScript. So generally, if we want to make a site independent of browser and operating system, on presentation layer we should go in for the combination of HTML and JavaScript.

Applet

Applet is a program which can be executed from browser. Applets also can be used in combination with HTML to provide Interactivity. To write an applet, the developer should be in a position to write Java code.

Business Tier

The Business Tier is the most complicated Layer.To understand how the business tier works, let us understand what it is going to contain.Any business has a set of predefined set of rules.These rules can be very simple such as "in the month of Diwali there has to be 10% discount" or a complex rule can set 10% discount for purchases belowRs. 1000, 15% discount for purchases between 1001 to 2500 Rs and so on.Since all business operations follow specified procedures and rules, then it follows that all software that drives that business must follow the exact same rules. The software implementationof these procedures is called Business Rules or Business Logic. Because we live in an object-oriented world, we implement these business rules in business objects. (COM/DCOM, EJB)
As the complexity of business logic increases this tier gets divided into multiple tiers and it is then called N-Tier application.
For Microsoft platform, our business layer can use applications like ASP(Active Server Pages) or COM/DCOM.
For Java platform, it includes server site programming tools like Servlet (ServerSide Applet), JSP (Java Server Pages) and EJB (Enterprise Java Beans). Recently Java platform is becoming popular as compared to Microsoft because of robust application development, Platform Neutral behaviour and many other advantages.

Database Tier

The database tier is the simplest one to understand. It is responsible for querying and manipulating the database under instructions from the business tier. Common database applications are SQL Server, Oracle etc.
One of the key things to remember in three tier application development is Presentation Tier should never talk to Database Tier. Generally for any application, business logic changes less frequently than the presentation layer. If you allow presentation layer to change database, the chances of errors and corrupting the database tier are fairly high. Making both layers connecting also means that presentation layer will require lots of modifications if database is changed.

The author Ms. Vaishali Tapaswi is Director, Fands Infotrainers and can be reached at
vaishali@fandsindia.com