Chapter 1: The Longhorn Application Model


Overview

Why do we need a new application model? One major reason is to bridge the gap between developing an application for Microsoft Windows and developing an application for the Web.

Today when you write a Windows application, you can take advantage of Windows features. Your application can provide a rich, responsive user interface. You can install the application on the client computer, which allows the application to run offline, without a network connection. Windows applications can take advantage of the hardware capabilities of the client computer.

However, traditional Windows applications also have a number of drawbacks. You typically must install a Windows application. This makes the application and any updates hard to deploy. Windows applications don t run in the browser. Therefore, familiar Web UI paradigms such as page-oriented applications, navigation directly from one page to another, page history, and more aren t available to your application unless you create them from scratch. Windows applications also don t support text very well, especially when you try to mix text and graphics on the same page. Creating a Windows application that automatically flows text around graphics and that responds to user-initiated changes in the window size and user preferences for fonts and readability is a huge amount of work.

Web applications have their own distinct strengths as well. When you browse to a Web page, the browser downloads only that page and the components the page requires. When you navigate to a new page, the browser then downloads the new page s requirements. In other words, the browser progressively downloads the application as needed.

Deployment of a Web application is trivial. What deployment? You place the necessary application components on a server, and the browser downloads them as needed. There s no deployment per se.

Creating the UI for a Web application is also quite easy. You declare your intentions using markup. For example, suppose I want a table in a specific position. I want an image to follow the table. I want some text to flow around the image. Mixing text, graphics, and media (sound and video) in a Web application is straightforward.

Of course, Web applications also have their bad points. You can t install a Web application on the desktop system; therefore, the application cannot run offline. You must always have a connection to the server. Certain application operations require roundtrips to the server, and that lessens performance. A Web application selection of controls is quite primitive in comparison to the available Windows controls. A Web application therefore typically has poor interactivity. It s also hard to develop an attractive UI for a Web application because you must express any non-trivial layout using tables.

Currently, developers designing new applications need to make an initial, huge, irreversible decision: should the application be a Web-style application or a classic Microsoft Win32 application? Completely separate programming models (and skills!) are needed depending on which application model you choose.

Longhorn allows you to develop applications using the best of both worlds . The Longhorn application model takes the best features of Web applications and the best features of Windows applications and combines them in a single unified programming model based on managed code.

A second major reason for developing a new application model is to provide a single programming model that can create the wide variety of applications in use today. Look at one of your favorite Web sites, such as CNN or MSNBC. Is the Web site a traditional application? Is it a document? Is it a multimedia presentation? In many cases, the answer is yes to all three questions.

When a Web site includes UI elements such as list boxes, edit controls, and radio buttons , it looks like an application presenting a UI. However, when it displays images and text flowing around the images, the Web site is similar to a document. When it presents Flash content, graphics, audio, video, and animation, the Web site seems to be a multimedia presentation.

Of course, such rich Web sites are difficult to develop. You need to patch together an HTML markup “based description of the page, with Microsoft ActiveX controls for a rich UI, with embedded Flash animations, and possibly using Portable Document Format (PDF) for document support. All these technologies use a different architecture, provide different performance characteristics, and require different programming models and tools.

This typically means that you must hire multiple developers with different skill sets to develop each portion of the application. The developers must then merge the different models into a single working application. Developing the application is hard enough. Debugging it is often a nightmare.

Longhorn provides a unified architecture that supports these three tiers ” documents, applications, and media. Do you want to create your UI declaratively using markup? Go for it. Do you need to use rich Windows controls? Then do so! Do you want to write event handlers in a strongly typed, managed language? You can do that as well. Do you want to mix text, graphics, and video in a document with intelligent layout and presentation according to the user s preferences and optimized for best viewing and reading on the client system? Guess what? You get that too.

The Longhorn application model makes it possible to write an application using a single programming model that supports application-style UI functionality, document-style presentation of text and graphics, and integration of various media. In addition, you can create the UI using markup like a Web application. You also get the deployment (or lack of deployment) ease of a Web application. However, you still have the performance and ability to install the application for offline use like a Windows application. Your application can run as a stand-alone application or hosted in a Web browser by simply recompiling one source code base. In either case, your application can be form-based, like many traditional Windows applications, or page-based, like Web applications.




Introducing Microsoft WinFX
Introducing WinFX(TM) The Application Programming Interface for the Next Generation of Microsoft Windows Code Name Longhorn (Pro Developer)
ISBN: 0735620857
EAN: 2147483647
Year: 2004
Pages: 83
Authors: Brent Rector

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