. NET Framework overview-. NET Framework developer Guide

Source: Internet
Author: User
Tags types of functions hosting server hosting

. NET Framework is a new computing platform that simplifies application development in a highly distributed Internet environment .. NET Framework is designed to achieve the following goals:

  • Provides a consistent object-oriented programming environment, regardless of whether the object code is stored and executed locally, locally, but on the Internet, or remotely.
  • Provides a code execution environment that minimizes software deployment and version control conflicts.
  • Provides a code execution environment that ensures secure code execution (including Code created by an unknown or untrusted third party.
  • Provides a code execution environment that can eliminate the script environment or explain the performance problems of the environment.
  • Ensure that the experience of developers is consistent with that of applications of different types (such as Windows-based and Web-based applications.
  • Generate all communications according to industrial standards to ensure that code based on. NET Framework can be integrated with any other code.

. NET Framework has two main components: Public Language Runtime Library and. NET Framework class library. The public Language Runtime Library is the basis of the. NET Framework. You can regard the Runtime Library as a proxy for managing code during execution. It provides core services (such as memory management, thread management, and remote processing ), strict type security and other forms of code accuracy that ensure security and reliability are also enforced. In fact, the concept of code management is the basic principle of the Runtime Library. Code with the Runtime Library as the target is called managed code, and code with the Runtime Library as the target is called unmanaged code .. Another major component of the. NET Framework is the class library, which is a comprehensive collection of reusable object-oriented types. You can use it to develop a variety of applications, these applications include traditional command line or graphical user interface (GUI) applications, and also include ASP-based. NET provides the latest innovative applications (such as Web forms and XML Web services ).

. The. NET Framework can be carried by unmanaged components that Load Common Language Runtime libraries to their processes and start the execution of managed code, in this way, you can create a software environment that can take advantage of both managed and unmanaged functions .. NET Framework not only provides several runtime database hosts, but also supports the development of third-party runtime database hosts.

For example, ASP. NET hosts the runtime to provide a Scalable Server Environment for hosted code. ASP. NET directly uses the Runtime Library to enable ASP. NET applications and XML Web services (this topic will discuss the two later ).

Internet Explorer is an example of an unmanaged application that hosts the Runtime Library (in the form of MIME-type extensions. Using Internet Explorer to host the runtime allows you to embed a management component or a Windows Form Control in HTML documents. In this way, the runtime makes it possible to host Mobile Code (similar to Microsoft ActiveX controls, however, it has major improvements that can only be provided by hosted code (such as incomplete trusted execution and secure independent file storage ).

The following illustration shows the relationship between the Common Language Runtime Library and the class library and the application and the entire system. The illustration also shows how managed code runs in a larger structure.

. NET Framework Environment


Functions of the Common Language Runtime Library

Common Language Runtime libraries manage memory, thread execution, code execution, code security verification, compilation, and other system services. These functions are inherent in the managed code that runs on the common language runtime.

As for security, depending on factors including the source of managed components (such as the Internet, enterprise network, or local computer), managed components are given different levels of trust. This means that even in the same active application, managed components may be able to perform file access operations, registry access operations, or other features that must be used with caution, or they may not be able to perform these features.

The Runtime Library enforces code access security. For example, users can believe that executable files embedded in Web pages can play animations or sing on the screen, but cannot access their personal data, file systems, or networks. In this way, the security function of the runtime database enables the Legal Software deployed over the Internet to have a particularly rich set of features.

The Runtime Library also enhances code reliability by implementing strict type verification and code verification infrastructure called CTS. CTS ensures that all managed code can be self-described. Various Microsoft and third-party language compilers generate CTS-compliant managed code. This means that managed code can use other managed types and instances while strictly implementing type fidelity and type security.

In addition, the Runtime Library's hosting environment eliminates many common software problems. For example, the Runtime Library automatically handles object la S and manages references to objects, releasing them when they are no longer used. This automatic memory management solves two common application errors: Memory leakage and invalid memory reference.

The Runtime Library also improves the efficiency of developers. For example, programmers can write applications in the development language they select, but can still make full use of the runtime libraries, libraries, and components written by other developers in other languages. Any compiler vendor that selects the Runtime Library as the target can do this. The. NET Framework-oriented language compiler allows existing code written in this language to use the. NET Framework function, which greatly reduces the workload of the migration process of existing applications.

Although the Runtime Library is designed for future software, it also supports current and previous software. The interoperability between hosted and unmanaged code allows developers to continue using the required COM components and DLL.

The Runtime Library is designed to enhance performance. Although the Common Language Runtime Library provides many standard Runtime library services, it never interprets hosted code. A feature called real-time (JIT) Compilation enables all hosted code to run in the local language of the system on which it runs. In addition, the memory manager eliminates the possibility of fragmented memory and increases the memory reference area to further improve performance.

Finally, the Runtime Library can be carried by high-performance Server-side applications (such as Microsoft SQL Server and Internet Information Service (IIS. This infrastructure enables you to use managed code to write business logic while enjoying the superior performance of the best enterprise server in the industry that supports the running Database Host.

. NET Framework class library

The. NET Framework class library is a reusable type set that is closely integrated with the public Language Runtime Library. This class library is object-oriented and provides the types of functions from which your hosted code can be exported. This not only makes the. NET Framework type easy to use, but also reduces the time required to learn new features of. NET Framework. Third-party components can be seamlessly integrated with classes in. NET Framework.

For example, the. NET Framework collection class implements a set of interfaces that can be used to develop your own collection classes. Your collection classes are seamlessly mixed with classes in. NET Framework.

As you expected for the object-oriented class library ,. NET Framework allows you to complete a series of common programming tasks (such as string management, data collection, database connection, and file access ). In addition to these common tasks, the Class Library also includes types that support multiple dedicated development solutions. For example, you can use. NET Framework to develop the following types of applications and services:

  • Console application.
  • Windows GUI applications (Windows Forms ).
  • ASP. NET application.
  • XML Web services.
  • Windows service.

For example, Windows form classes are a set of comprehensive reusable types, which greatly simplify the development of Windows GUI. To write an ASP. NET Web forms application, you can use the Web forms class.

Client application development

Client applications are the most similar to traditional applications in Windows-based programming. These are application types that display windows or forms on the desktop so that you can execute tasks. Client Applications include applications such as Word processing programs and workbooks, as well as custom business applications (such as data input tools and report tools ). Client applications typically use Windows, menus, buttons, and other GUI elements, and they may access local resources (such as file systems) and peripheral devices (such as printers ).

Another client application is a traditional ActiveX Control deployed on Web pages over the Internet (it is now replaced by a hosted Windows form control ). This application is very similar to other client applications: It runs locally and can access local resources and contain graphical elements.

In the past, developers used C/C ++ and Microsoft Basic class (MFC) or Rapid Application Development (RAD) environments (such as Microsoft Visual Basic) to create such an application .. NET Framework combines the features of these existing products into a single and consistent development environment, which greatly simplifies the development of client applications.

The Windows Forms class contained in. NET Framework is intended for GUI development. You can easily create command windows, buttons, menus, toolbar, and other screen elements with the flexibility needed to adapt to changing business needs.

For example,. NET Framework provides simple attributes to adjust the visual attributes associated with the form. In some cases, the basic operating system does not support direct modification of these properties, and in these cases, the. NET Framework will automatically recreate the form. This is one of the many methods that integrate the. NET Framework developer interface to make the encoding simpler and more consistent.

Unlike ActiveX controls, Windows Forms controls have access permissions that are not fully trusted to users' computers. This means that binary code or code executed locally can access certain resources on the user's system, such as GUI elements and restricted files, but such code cannot access or harm other resources. Due to the security of code access, many applications that have been installed on the user system can be deployed securely on the Web. Your applications can be deployed as Web pages to implement the functions of local applications.

Server Application Development

In the hosting field, server-side applications are implemented through the running Database Host. Unmanaged applications host the public Language Runtime Library, which enables your custom hosting code to Control Server behavior. This model provides all the functions of the Common Language Runtime Library and class library while obtaining the performance and scalability of the master server.

The following illustration shows the basic network architecture for running managed code in Different server environments. When the application logic is executed by hosting code, servers (such as IIS and SQL Server) can perform standard operations.

Server hosting code

ASP. NET is a host environment that enables developers to use. NET Framework to develop Web-based applications. However, ASP. NET is not only a runtime Database Host, but also a complete structure of objects that are used to develop Web sites and distributed over the Internet using managed code. Both Web forms and XML Web services use IIS and ASP. NET as the publishing mechanism of applications, and both have a set of support classes in. NET Framework.

XML Web services, as an important development of Web-based technology, is a distributed server-side application component similar to common Web sites. However, unlike Web-based applications, XML Web services components do not have a UI and are not targeted by browsers (such as Internet Explorer and Netscape Navigator. XML Web services are composed of reusable software components for other applications. Other applications include traditional Client Applications and Web-based applications, other XML Web services. Therefore, the XML Web services technology is rapidly pushing application development and deployment to a highly distributed Internet environment.

If you have used an earlier version of ASP technology, you will soon notice the improvements provided by ASP. NET and Web forms. For example, you can develop Web forms pages in any language that supports. NET Framework. In addition, your Code no longer needs to share the same file with HTTP text (although you can continue to do so if you want ). Web forms pages are executed in the local language because they take full advantage of the runtime just like all other hosted applications. In contrast, unmanaged ASP pages are always written as scripts and interpreted. ASP. NET pages are faster, more practical, and easier to develop than unmanaged ASP pages because they interact with the runtime like all hosted applications.

. NET Framework also provides a collection of classes and tools to help develop and use XML Web services applications. XML Web services are generated based on SOAP (A Remote Procedure Call Protocol), XML (A Scalable Data Format), and WSDL (Web Service Description Language. The. NET Framework is generated based on these standards to improve interoperability with non-Microsoft Solutions.

For example ,. the Web Service Description Language tool included in the NET Framework SDK can query XML Web services published on the Web, analyze its WSDL description, and generate C # or Visual Basic source code, your application can use this code to become the XML Web services Client. These source code can create classes derived from classes in the class library, which use SOAP and XML analysis to process all basic communication. Although you can use a class library to directly use XML Web services, the Web Service Description Language tool and other tools included in the SDK make it easier for you to use. NET Framework for Development.

If you develop and publish your own XML Web services,. NET Framework provides you with a set of classes that comply with all basic communication standards (such as SOAP, WSDL, and XML. These classes enable you to focus on the logic of the service without having to focus on the communication infrastructure required by distributed software development.

Finally, similar to the Web forms page in the hosting environment, your XML Web services runs at the speed of your local language using IIS scalable communication.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.