Guide to Reviewing the Microsoft. Net framework




старонка5/12
Дата канвертавання24.04.2016
Памер308.55 Kb.
1   2   3   4   5   6   7   8   9   ...   12

What the Programmer Sees: The Unified Classes


The classes of the .NET Framework provide a unified, object-oriented, hierarchical, and extensible set of class libraries, or APIs, that developers can use from the languages they are already familiar with.

Today, Visual C++ developers use the Microsoft Foundation Classes, Visual J++ developers use the Windows Foundation Classes, and Visual Basic developers use the Visual Basic framework. Simply put, the classes of the .NET Framework unify these different classes, creating a superset of their features. The result is that developers no longer have to learn multiple object models or class libraries. By creating a common set of APIs across all programming languages, the .NET Framework enables cross-language inheritance, error handling, and debugging. In effect, all programming languages, from JScript to C++, become equal, and developers are free to choose the right language for the job.



The .NET Framework unified classes.

The .NET Framework provides classes that can be called from any programming language. These classes comply with a set of naming and design guidelines to further reduce training time for developers. Some of the key class libraries are shown in the figure at left.

The .NET Framework includes a base set of class libraries that developers would expect in any standard library, such as collections, input/output, data type, and numerical classes. In addition, there are classes that provide access to all of the operating system services—such as graphics, networking, threading, globalization, cryptography, and data access—classes that development tools can use—such as debugging—as well as a set of classes that supply the services necessary for building enterprise-scale applications—such as transactions, events, partitions, and messaging.

Although this Reviewers Guide has focused on the Microsoft .NET Framework as a way to develop XML Web services and Web applications, the unified programming classes also offer full support for developing more traditional Windows-based applications (these applications can use XML Web services, too).

Developers who write client applications for Windows can use the Windows Forms (System.Windows.Forms) classes to take advantage of all of the rich user interface features of Windows, including existing Microsoft ActiveX® controls and new features of Windows 2000, such as transparent, layered, and floating windows. Developers will find the Windows Forms programming model and design-time support very intuitive, given their similarities to existing Windows-based forms packages.

Web Applications: ASP.NET

A set of classes within the unified class library, ASP.NET provides a Web application model in the form of a set of controls and infrastructure that make it simple to build Web applications.

ASP.NET comes with a set of server-side controls (sometimes called Web Forms) that mirror the typical HTML user interface widgets (including list boxes, text boxes, and buttons), and an additional set of Web controls that are more complex (such as calendars and ad rotators). These controls actually run on the Web server and project their user interface as HTML to a browser. On the server, the controls expose an object-oriented programming model that brings the richness of object-oriented programming to the Web developer.


A view of ASP.NET.

One important feature of these controls is that they can be written to adapt to client-side capabilities; the same pages can be used to target a wide range of client platforms and form factors. In other words, Web Forms controls can sniff the client that is requesting a page and return an appropriate user experience— WML for phones or HTML 3.2 for a down-level browser and Dynamic HTML for Internet Explorer 5.5.

ASP.NET also provides cluster session-state management and process recycling, which further reduce the amount of code a developer must write and increase application reliability.

ASP.NET uses these same concepts to enable developers to deliver software as a service. Using ASP.NET XML Web services features, ASP.NET developers can simply write their business logic, and the ASP.NET infrastructure will be responsible for delivering that service via SOAP and other public protocols.

ASP.NET works with all development languages and tools (including Visual Basic, C++, C#, and JScript).


Inside ASP.NET


At the core of ASP.NET is its HTTP runtime (different from the common language runtime), a high-performance execution engine for processing HTTP commands. The HTTP runtime is responsible for processing all incoming HTTP requests, resolving the URL of each request to an application, and then dispatching the request to the application for further processing. The HTTP runtime is multithreaded, and it processes requests asynchronously—which means it cannot be blocked by bad application code from processing new requests. Furthermore, the HTTP runtime has a resilient design that is engineered to recover automatically from access violations, memory leaks, deadlocks, and so on.

Updating Applications


ASP.NET uses the Microsoft .NET Framework deployment technologies, thus gaining benefits such as XCOPY deployment and side-by-side deployment of applications.

Another major benefit of ASP.NET is support for live updating of applications. An administrator does not need to shut down the Web server or even the application to update application files: Application files are never locked, so they can be overwritten even when the application is running. When files are updated, the system gracefully switches over to the new version.


Extensibility


Within an ASP.NET application, HTTP requests are routed through a pipeline of HTTP modules, ultimately to a request handler. HTTP modules and request handlers are simply managed .NET classes that implement specific interfaces defined by ASP.NET. This modular architecture makes it very easy to add services to applications: Just supply an HTTP module. For example, security, state management, and tracing are implemented as HTTP modules by ASP.NET. Higher-level programming models, such as XML Web services and Web Forms, are also implemented as request handlers. An application can be associated with multiple request handlers—one per URL—but all HTTP requests in a given application are routed through the same HTTP modules.

State Management


The Web is a fundamentally stateless model with no correlation between HTTP requests. This can make writing Web applications difficult, since applications usually need to maintain state across multiple requests. ASP.NET enhances the state management services introduced by ASP to provide three types of state to Web applications: application, session, and user. ASP.NET session state is stored in a separate process and can even be configured to be stored on a separate machine or persisted to a Microsoft SQL Server™ database. This makes session state scalable even when an application is deployed across the largest Web farms,

User state resembles session state, but generally does not time out and is persisted. Thus user state is useful for storing user preferences and other personalization information. All the state management services are implemented as HTTP modules, so they can be added, extended, or even removed from an application's pipeline easily. If additional state management services are required beyond those supplied by ASP.NET, they can be provided by a third-party module.


Caching


The ASP.NET programming model provides a cache API that enables programmers to activate caching services (on enterprise software) to improve performance. An output cache saves completely rendered pages, and a fragment cache stores partial pages. Classes are provided so that applications, HTTP modules, and request handlers can store arbitrary objects in the cache as needed.

Aggressive caching capabilities will be provided as part of ASP.NET. ASP.NET is designed to provide a robust Web application environment capable of running mission-critical projects for long periods of time.

ASP.NET is delivering some significant improvements in Web application performance—a throughput improvement of up to three times over existing ASP-based applications, and even more dramatic productivity improvements.

1   2   3   4   5   6   7   8   9   ...   12


База данных защищена авторским правом ©shkola.of.by 2016
звярнуцца да адміністрацыі

    Галоўная старонка