Server-Side Programming

 <  Day Day Up  >  


When adding interactivity to a Web page, it often makes sense to add a majority of the functionality on the server side unless the interactivity is purely client-side in nature, such as animation or user interface related issues. There are two basic reasons for doing this. First, the server side is the only part of the equation that can be completely controlled. If you only rely on the browser to render HTML pages, life is relatively simple. If you assume that users have JavaScript, Java, or a particular plug-in, things become less predictable. Given that most modern browsers come with many of these technologies, this might seem unlikely . However, the reality is that there are just too many variables and too many bugs. Users often turn off support for Java, JavaScript, or ActiveX due to fear of security breaches. Even when turned on, these technologies aren't as reliable as we might like. For example, JavaScript comes in numerous flavors, all with their own subtle and not-so-subtle differences, including feature disparity and bugs . It is no wonder we would want to move computation to the server, where these issues are more controllable.

While server-side computing provides safety and control, it relies greatly on server resources. In many Web sites, the server is required to do all the computation, from database access to building dynamic pages. In such a scenario, the browser is responsible for only basic page rendering and simple data collection tasks such as form entry. The downside to such heavy reliance on the server is that it is the critical part of the interactivity. If the server becomes overloaded or the network connection to the server is clogged, the result might be an unresponsive site and a disappointed user. Although control is gained with server-side programming, it is exchanged for speed and scalability.

For now, let's put the theory aside and turn our discussion to the various approaches to server-based interactivity. Let's start first with CGI programs and use them to explain the fundamentals of how any server-side technology interacts with a Web browser, markup, and related Web technologies.



 <  Day Day Up  >  


HTML & XHTML
HTML & XHTML: The Complete Reference (Osborne Complete Reference Series)
ISBN: 007222942X
EAN: 2147483647
Year: 2003
Pages: 252
Authors: Thomas Powell

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net