Home      Affiliated Colleges      Course content      First Sem     Second Sem     Third Sem     Fourth Sem     Fifth Sem     Sixth Sem     Seventh Sem     Eighth Sem     Lab report 4th sem     Contact    

Tuesday, May 17, 2011

Web Technology:-Windows Applications and Web Applications

Windows Applications and Web Applications

Developers are often confused about the difference between Windows Applications and Web Applications. Above shown details will provide you brief information about various types of computer applications and provides an introductions to web applications.

Different types of computer applications



It is very hard to divide applications into any strict categories. There is no clear definition exists to categorize computer applications. However, here is a small list of different types I can think of:

1. Embedded Systems
2. Windows applications (also called 'Desktop applications')
3. Web Applications

Embedded Systems



Have you ever used a digital diary (also called 'digital organiser') or a mobile phone ? Do you know when you save a name and address, how does it get saved in it?
It is a small computer program 'Embedded' in that device. It is similar to any small address book computer program that you can write using your favorite visual basic or c++. The only difference is, it is written using soem special language and 'embedded' into a chip in the device inside the mobile phone or digital diary.
If you find a bug in a regular computer program, you can simply write a better program, compile it and copy to your computer. But if you find a bug in your mobile phone's embedded program, you cannot copy it! The manufacturer has to embed the new program in a new chip and replace the chip in your mobile phone!!

Windows Applications



If you don't know what is a 'Windows Application', probably you have never seen a computer. Almost any application you see on a desktop computer is called 'Windows Application'.
It is also called 'desktop applications' since they are mostly used in desktop computers.

Some common examples of desktop applications are:
1. Paint Brush program
2. Calculator program
3. MSN Messenger
4. Yahoo Messenger
The first three windows applications are written by some programmers sitting in Microsoft office and they give it free to all who buy Windows operating system. The Yahoo messenger is written by Yahoo programmers and they give it free to download from their web site.

If your neighbour ask you to write small 'Address book' application for his personal use, you are going to write a 'windows application'.
Now you must have a good idea of what is windows application.

Web Applications


I am sure you have seen atleast one web application! Do you know how I guessed it?
It was easy to guess. This tutorial is a web application and you are currently reading this tutorial from our web site (unless you copied it to somewhere...)

So, what is a web application?


A web application is also called 'web site'. A web site is a collection of web pages hosted on a special computer called 'web server'.
Now you are reading this tutorial. This chapter is a page among several other pages part of our web application. The name of our web application is 'AspSpider.com'. This web site (web application) is running in our web server, which is located in a safe place in USA. You are a 'visitor' to our site and you are accessing our web application using a tool called 'Internet Explorer' (or, some other browser like Netscape etc). We don't know where you are (we have several ways to find it, which we will explain in some other chapter)
So, here is some interesting points about a web application:
  • A web application is a collection of web pages.
  • A web application needs a web server to run.
  • Web server can be located anywhere and visitors need not be even in the same country of the web server.
  • Visitors can access the web application using a tool called 'browser'. There are many browsers exists. Most widely used browser is 'Internet Explorer'. This is provided by Microsoft and it is free. Another famous free browser is 'Netscape'.


Hope this chapter gave a clear picture about web applications and how they are different from windows applications.
Infrastructure to develop a web application (web site)


So, ready to develop a web site?

Anyone who want to develop a web application must have the following systems:

1. A web server.

2. An editor to develop the web pages.

3. A browser to view the web page you develop.

4. A database program like MS Access, SQL Server etc, if your web site need to save data into a database.

In the real world situation, a web server will be hosted on a secure server, located in a safe place and will be always connected to high speed internet. However, to develop a web application, you don't need to worry about security and internet connectivity. You can use your own development computer as the 'Web Server'.

So, your development computer must have all the 4 systems mentioned above.

Note: Web Server


There are several types of web servers. But if you like to develop ASP.NET web applications, you need a specific web server called 'Internet Information Server' (IIS).
IIS comes as part of Windows. But it is not installed by default, when you install Windows. Please see the chapter 'Installing IIS' to find more about installing IIS.

Editor to develop web pages


Ideally, you do not need any special editor to develop a web application. If you are an expert, you can simply use ntoepad to type HTML and the code for the web pages. However, who want to hand-wash the vessels when there is a dish washer?!
You don't need to make your hands dirty! Microsoft gives a tool called 'Visual Studio .NET' to edit web pages and write code for ASP.NET.

Visual Studio .NET (VS.NET)


Visual Studio .NET allows to easily create web pages. Some of the benefits in using Visual Studio .NEt are:

  • You can simply drag and drop html controls to the web page and VS.NET will automatically write the HTML tags for you.
  • Start typing an HTML tag and VS.NET will complete it! When you start typing a tag, VS.NET will show you the HTML tags starting with the characters you typed. So, you don't need to even remember all the tags.
  • If you type any HTML tags wrong, VS.NET will highlight the errors and tell you how to correct it.

So, even if you are not an expert, VS.NET can help you develop great web pages.

Browser


You need a browser to view the web pages you create. If you have any windows operating system in your computer, you will already have a free browser (called 'Internet Explorer')

Database program


A database program like MS Access or SQL Server is required only if you need to save data into database. It is not mandatory that all web sites need a database program.

What is a virtual directory?



A virtual directory represents a web application and it points to a physical folder in your computer.

A web application is accessed using a virtual directory name instead of a physical folder name. For example, if you have a web application called "Shopcart" in your machine, you will have a virtual directory for this web application. You will access your web application using the URL httP://localhost/Shopcart. If your virtaul directory name is "Test", then your web application url will be "http://localhost/Test".

Assume you have a web application called "Shopcart", created under the physical folder "C:\MyProjects\Shopcart".

You can go to IIS and see this virtual directory listed. Right click on this virtual directory name in IIS and see the properties. You can see that this virtual directory is pointing to the physical location "C:\MyProjects\Shopcart".

If you have a file called "File1.aspx" under the folder "C:\MyProjects\Shopcart\", then you can access this file using Internet Explorer with the URL "http://localhost/Shopcart/File1.aspx"

How to create a virtual directory?



When you create a new web project using, a new virtual directory will be created automatically for you. This virtual directory will point to a new folder created under C:\Inetpub\wwwroot.

If you like to better organize your projects and files in your favourite folder, you must manually create a new folder for each project in your preferred location and convert it into a virtual folder manually.

There are couples of ways you can do this.
Method 1: Open the IIS. Right click on the node "Default Web Site" and select "new Virtual Directory". When it prompt you to enter the "alias", enter the virtual directory name you want(Eg: Shopcart). In the prompt for "directory", select the folder which you want to make a virtual directory (Eg: C:\MyProjects\Shopcart). Select other default values and press "Finish". Now you should be able to see your new virtual directory in IIS.

Method 2: In the explorer, go to the folder(Eg: C:\MyProjects\Shopcart) which you want to make a "virtual directory". Right click on the folder name and select "Properties". Select the tab "Web sharing" and select teh option "Share this folder". It will prompt you with a default Alias name same as the folder name (Eg: Shopcart). Simply select the default values and press "OK".

How web applications work?

Web applications work quite different from regular windows applications. This chapter explains the fundamentals of a web application and how a web page is served when a client makes a request for a web page.

Life Cycle of a Web Request

Viewing a web page is a simple process for a visitor. Just type the URL in a web browser like Internet Explorer or click on a hyper link in any existing web page. The web browser will display the page instantly to you.
But do you know that there are several computers involved in this process? Even though it is a very complex process, we can summarize the process as shown below:

1. You type the web page address (URL) in a browser. For example, consider the current page http://www.aspspider.com/tutorials.aspx. This URL has 3 parts:

  • The protocol - http:
  • The server name - www.aspspider.com
  • The file name - tutorials.aspx

2. Browser communicates with a computer in internet called 'Domain Name Server' to find out the IP Address of the server (Eg:
www.aspspider.com).
3. Browser established a connection to the web server at that IP Address.
4. Server composes a 'Request' for the specified URL and sends the request to the web server to which it has established a connection.
5. The web server identifies the type of the page requested. If it is an asp.net web page, then browser knows that needs some processing by the asp.net service running as part of the web server. The request is handed over to the asp.net service. The asp.net service processes the asp.net page and generates the html output.
6. Web server sends the requested page to the browser.
7. When a response is received by the browser, it displays the web page to the user who typed the URL.
After you typed the URL in the browser, the request sent by the browser may go through several computers in the internet before it reaches the actual web server.
You must be surprised to know that so many things happen and several computers are involved before a simple web page is displayed to you. Most of the steps in the above process happens behind the screen. A visitor need not worry about how a web page is processed and served to the browser.
So, by now you must have got a better picture about how a windows application is different from a web application. When you run a windows application (desktop application), only one computer is involved in the whole process. You start an application in your computer and it runs in your computer. But when you request a web page from your home computer, the request goes through several servers in the internet and finally it reaches a computer called 'Web Server'. The actual web page is processed in the web server.

No comments:

Post a Comment

^ Scroll to Top Related Posts with Thumbnails ^ Go to Top