Chapter 2. Web Forms


As technologies mature, the programmatic interface to those technologies rises in its level of abstraction. Web applications are finally maturing, and the abstraction level rises with ASP.NET. An analogous transition was made not so long ago with desktop applications. Building an application for a PC used to mean that you had to develop your own interface, including menuing systems, window interaction, mouse and keyboard interaction, and so on. With the advent of platforms such as Macintosh and Windows , the level of abstraction rose. Developers could take advantage of core windowing components that managed menus and windows for them, and it became much rarer for developers to have to render pixels to the screen to interact with the user. Instead, a program now consists of collections of components that are prebuilt to render themselves to the screen and receive input from the user . Developers can then work with these higher-level components to construct applications. Each component has state associated with it, like the text of a menu item or the bitmap image to render to in a window, and it has a mechanism for rendering that state to the target device (usually the screen). Developers construct programs by manipulating the state of these components, and let the objects render themselves automatically, as depicted in Figure 2-1.

Figure 2-1. Conceptual Model for Desktop Applications

graphics/02fig01.gif

Web applications are very different from desktop applications, but analogies can be drawn between the two types of applications. Instead of rendering by drawing pixels to a display, Web applications render by generating HTML to be processed by a browser. The current state of Web application development is analogous to desktop application development before windowing operating systems were available. Each request is serviced with an HTML response, typically created by performing some data lookup on the server machine and then carefully constructing the HTML to represent that data to the client. While HTML is much higher-level than pixel rendering, the concept of mapping state in an application to HTML for the client to view is similar. That HTML today is rendered primarily by using printf or its equivalent to write strings into a response buffer that is carried back to the client.

Now, instead of manually generating the HTML for clients to view the server-side state, we construct a model with a higher level of abstraction, similar to the window component model that windowed operating systems provide. Instead of using windows that know how to render themselves as pixels to a screen, however, we create a set of objects that can render themselves as HTML to the response buffer. This approach potentially can provide similar improvements in developer productivity by removing the details of HTML generation from the hands of developers and letting them focus on the state of a set of components that can render themselves as HTML. This conceptual model is illustrated in Figure 2-2.

Figure 2-2. Conceptual Model for Web Forms Applications

graphics/02fig02.gif



Essential ASP.NET with Examples in Visual Basic .NET
Essential ASP.NET with Examples in Visual Basic .NET
ISBN: 0201760398
EAN: 2147483647
Year: 2003
Pages: 94
Authors: Fritz Onion

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