Web Computing

Embed Size (px)

Citation preview

  • 8/2/2019 Web Computing

    1/8

    Web ComputingWeb computing can be defined as a special kind of distributed computing that

    involves internet-based collaboration of several remotely located applications.

    Contrary to the "classical" distributed components that are static and rely upon a

    fixed hardware configuration within a local area network, a new approachadvocates existence of dynamic functionalities that can be easily migrated and

    executed on any machine connected to the Web. The new style of computing

    requires a uniform run-time environment, broadband connections and flexible

    software structures.

    With the arrival of the Internet and the Web, we can now access information, even

    do business from virtually anywhere. For this fulfillment, there are many

    challenges ahead like designing and developing faster, lighter and more robust

    applications that can be delivered across the Web using HTTP protocol. This sort

    of applications are called Web applications. The tools and the technologies fordeveloping, delivering and deploying Web applications.

    Web Architecture

    The architecture is very simple and straightforward. To view a web page in

    our browser, we have to type the URL for that page or click an existing hyper-link

    to that URL. Once we submit this request and the web server receives this, the web

    server locates the web page from its memory or from its hard disk and sends it

    back to the browser. The browser then displays the page. Each image in the page isalso referenced by a URL and the browser requests each image URL from theserver in the same way it requested the main HTML page.

    The Web Browser

    The web browser can be thought of as a universal graphical user interface.

    whether we are doing some simple web browsing or transacting online banking,

    the web browser's responsibilities are that of presenting web content, issuing

    requests to the web server and handling any results generated by the request. There

    are two main web browsers in the market. They are Microsoft Internet Explorerand Netscape Communicator. Both brings some incredible power on the client side

    and evolved into fully programmable document containers. Each has its own object

    model allowing for scripts, or objects, to manipulate the elements of the document

    itself. Scripting languages like VBScript or JavaScript can be used to perform

    client-side data validation or provide some interactivity within the document.

  • 8/2/2019 Web Computing

    2/8

    Dynamic HTML (DHTML) is a combination of HTML, Cascading Style

    Sheets (CSS), the document object model, and scripting languages. CSS are a

    better way of positioning and formatting HTML elements. And since each property

    of the style sheet is made visible to the object model, we can use some script to

    manipulate and reposition HTML elements. DHTML, as a whole, provides a

    greater level of interactivity within our pages. It also adds much more control overthe presentation of them as well.

    The latest must-have browser feature is Extensible Markup Language

    (XML) support. XML allows us to define our own tag set to characterize our data,

    and to construct documents and data structures using these tags. XML provides a

    way for structured data to be self-describing, and that means the data can be

    portable. Also there is XHTML, the combination of XML with HTML.

    Furthermore, with Extensible Style-Sheets Language (XSL), we can select the data

    we want to view, and even change tag names, allowing us to transform XML tagsto HTML. Depending upon the type of browsers, the XSL will change XML: toHTML for web browsers, to WML for WAP browsers etc.

    The web browser is also capable of executing applications within the same

    context as the document on view. The tow most popular choices for client-side

    web applications are Microsoft's ActiveX technology and Java applets. ActiveX

    components are downloaded from the web server, registered with the Windows

    registry, and executed when called upon by other script elements. A Java applet is

    a small Java program also downloaded from the web server, and executed within

    the browser's own Java Virtual Machine (JVM). Both ActiveX objects and Javaapplets have full access to the browser's document object model and can exchange

    data between the browser and themselves. Thus the web browser always serve the

    purpose of being our 'window to the world'. It serves as our primary user interfaceas we browse the web, conduct online business or even play games.

    The Web server

    The web server is the heart of any web interaction. The web server is a

    software program running on the server machine that listens for incoming requests

    from the web browser and serves those requests at any time. Once the web server

    receives a request, it then springs into action. Depending on the type of request, the

    web server might look for a web page, or it might execute a program on the server.

    Either way, it will always return some kind of results to the web browser, even if itmight be an error message.

    http://www.peterindia.net/javascriptOverview.htmlhttp://www.peterindia.net/javascriptOverview.htmlhttp://www.peterindia.net/javascriptOverview.htmlhttp://www.peterindia.net/CSSOverview.htmlhttp://www.peterindia.net/CSSOverview.htmlhttp://www.peterindia.net/XMLOverview.htmlhttp://www.peterindia.net/XMLOverview.htmlhttp://www.peterindia.net/XMLOverview.htmlhttp://www.peterindia.net/XMLOverview.htmlhttp://www.peterindia.net/CSSOverview.htmlhttp://www.peterindia.net/javascriptOverview.html
  • 8/2/2019 Web Computing

    3/8

    Currently there are two top web servers. They are the Apache web server

    and Microsoft's Internet Information Server (IIS). The first one has been developed

    as free software and has been contributed to by programmers around the world. Its

    power, flexibility, ease of use and the availability for multiple platforms has

    immensely contributed to its rise in popularity over the past few years. Microsoft's

    IIS, on the other hand, runs on the Windows NT and Windows 2000 operating

    systems. While it offers a wide range of features, its dependence on the Windows

    platform is being a major drawback. After the advent of the Linux operating

    system, the usage and popularity of the Apache web server gets multiplied. Thus

    the web server is poised to play a very important role in our server-side

    applications.

    Web Application Architecture

    A web application typically follows a three-tiered model. The first tierconsists of the presentation layer which, in the case of web application, includes

    not only the web browser but also the web server, which is responsible for

    assembling the data into a presentable format. The second tier is the application

    layer. It usually consists of some sort of script or program. Finally the third tier

    provides the second tier with the data that it needs. A typical web application will

    collect data from the user (first tier), send a request to the web server, run the

    requested server program (second and third tiers), package up the data to be

    presented in the web browser, and send it back to the browser for display (first

    tier).

    Collecting the data - The first step of a web application usually involves collecting

    some kind of data from the user using a simple HTML form. The user would type

    some information into some form fields and the information will be taken to the

    web server for being processed and finally the result will be sent back to the user.

    There is an alternative mechanism for this using Java applets, which can be used as

    a client to a server-side program by simply opening up a socket connection to the

    web server. This approach can help to move the majority of data formatting and

    validation off the server and onto the client. This approach reduces the volume of

    network traffic to a major extent. Sending the Web Server a Request - In order forthe web server to spring into action and execute a server program, the web browser

    needs to package up the user data and issue an HTTP request to the web

    server HTTP/HTTPS is a simple, stateless, lightweight application-level protocol

    generally implemented over TCP/IP connections. The HTTP is a stateless protocol

    based on requests and responses. It was originally meant for serving static

    information. In this paradigm, client applications, such as a Web browser, send

  • 8/2/2019 Web Computing

    4/8

    requests to the servers, such as a Web server, to receive information or to initiate a

    specific processing on the server. As an application level protocol, HTTP defines

    certain types of requests that clients can send to servers. The protocol also specifies

    how the requests and responses be structured. The latest version HTTP/1.1, in

    addition to GET, POST and HEAD, has five additional request methods:

    OPTIONS, PUT, TRACE, DELETE, and CONNECT. Of these, the GET and

    POST requests meet most of the common application development needs.

    The GET request method is the simplest and most frequently used request

    method for accessing static resources such as HTML documents, images etc. GET

    requests can also be used to retrieve dynamic information by using additional

    query parameters in the request URL. For example, I can send a parameter

    name=peter appended to a URL as http://www.peterindia.com?name=peter. The

    Web server can use this parameter name=peter to send the content specific to

    "peter".

    The POST request method is normally being used to access dynamic

    resources. POST requests are meant to transmit information that is request

    dependent, and are used when we need to send large amounts of complex

    information to the Web server. The POST request helps to encapsulate multi-part

    messages into the request body. For example, we can use POST requests to upload

    text or binary files. Also POST requests can be used to serializable Java objects to

    the Web server through our applets. Thus POST requests offer a wider choice in

    terms of the contents of a request.

    There are certain differences between GET and POST requests. With GET

    requests, the request parameters are transmitted as a query string appended to the

    request URL. In the case of POST requests, the request parameters are transmitted

    within the body of the request. Since a GET requests contains the complete request

    information appended to the URL itself, it allows browsers to bookmark the page

    and revisit later. If the parameters to be passed happen to be sensitive, then the

    GET method may be not suitable. Also some Web servers, not complying with

    HTTP/1.1, may put some restrictions on the length of request URL.

    These two method requests are set to be idempotent, that is, they are not

    programmed to modify the information on the Web server. An idempotent request

    can be reapplied without changing any data on the server side. These are used for

    pure information retrieval. Along with the type of the request, the client applicationalso specifies the resource that it needs as part of the request header.

  • 8/2/2019 Web Computing

    5/8

    HTTP Response - For a HTTP request from a Web browser, the Web

    server responds with the status of the response, and some meta-information

    describing the response. All these are part of the response header. Except for the

    case of the HEAD method request, the server also sends the body content that

    corresponds to the resource specified in the request. The body content is actually

    what we want to get from the Web server. But the content header fields in the

    response contain useful information, such as "Date", "Content-Type", "Expires",

    etc.

    In HTTP, servers and clients use MIME (Multi-Purpose Internet Mail

    Extensions) to indicate the type of content in requests and responses. Examples of

    MIME types are text/html, image/gif, etc. Here the first part of the header indicates

    the type of data, such as text and image, while the second part indicates the

    standard extension, such as html for text and gif for image. MIME is an extension

    of the email protocol to allow exchange of different kinds of data files over theInternet. HTTP servers use MIME headers at the beginning of each transmission.

    Web browsers use this information to decide how to parse or render the response.

    Web browsers also use MIME headers while transmitting data in the body of

    requests, to describe the type of data being sent. That is all about the HTTP

    request-response process.

    Executing the Server Script or Program - An important function of the web

    server is that of passing a request to a specific script, or program to be processed.

    The web server first determines which type of operating environment it needs to

    load by looking at the extension of the requested file or the directory the file islocated in. This is being done through mapping. When a web server is configured,

    it is told how to handle specific file types. For example, typically anything in the

    cgi-bin directory will be treated as a CGI script or anything with a .asp or .jsp

    extension will be treated as a Active Server Page or a Java Server Page

    respectively.

    Once the web server determines the type of the requested file, it then loads

    any required runtime environment for the file to be executed. For example, if a

    CGI program were written in Perl, the web server would create a new process andload the Perl interpreter into it. For some types of programs depending on the web

    server, there is no necessity for loading a separate runtime environment.

    Returning the Results to the Browser - The final step in a web application

    is to make some kind of response to the operation and return that to the browser.

    Generally speaking, the server script specifies the content type and then writes the

  • 8/2/2019 Web Computing

    6/8

    response to an output stream. When the web browser receives the response, it will

    first look at the response header and determine the MIME type so that it knowshow to render the data.

    Server-Side Web Programs

    A server-side web program has some important exceptions from a regular

    program. To make a program accessible to a web server, it must possess thefollowing characteristics:

    i. When a user issues a request from a web browser, the web server has to

    be able to locate and execute the requested program

    ii. There must be a way in which the web server passes any form data to theprogram.

    iii. Once the program is invoked, there has to be a standard entry point

    iv. After the program has processed the input data, it has to package up the

    results and send them back to the web server which will, in turn, send them back to

    the web browser. The exact division of responsibility may vary for different web

    servers. But all web servers just talk HTTP.

  • 8/2/2019 Web Computing

    7/8

  • 8/2/2019 Web Computing

    8/8