.NET development platform research (1)

zhaozj2021-02-16  59

.NET development platform research

to sum up:

The release of the .NET development platform marks the first major transformation of Microsoft Development Platform in the past decade. This development platform includes a new software infrastructure (.NET Framework, and ASP.NET) for loading and running applications, a new development environment (Visual Studio .NET), and supporting programming languages.

Microsoft hopes that as this new platform is released, comments no longer use this platform as a hazy software, and developers will also find that the platform makes the Web application (especially web service) on Windows. This may allow more developers to support the company's operating system and server products and attract them from the competition with the Java platform.

Microsoft customers can use the platform as a more reliable, safer and more unified standard, while Microsoft's partners can strengthen contact with the company by helping to create early victory for the platform. However, whether customers or partnerships should be aware that new platforms ask them to simply master new applications programming interfaces and programming languages, and it can lock them on Microsoft's operating systems and server products.

1. Noun introduction:

Microsoft released the .NET development platform, this is the first large upgrade of Microsoft Software Development Platform since the Win32 API appeared in Windows NT3.0 in July 1993. For Win16, Win32 provides more powerful APIs, but there is no change in tools and technology. In contrast, .NET development platform has changed fundamental changes in developers to create applications.

The .NET development platform makes developers to create a web application that runs on Internet Information Server (IIS) WEB server, which also makes creating stable, reliable and secure Windows desktop applications easier . The .NET development platform includes the following:

· .NET Framework, including: Common Language Runtime (CLR) (universal language running environment), is a software component for running and loading applications; new class libraries, grading organized developers can be in them The application is used to display the graphical user interface, access the database, and files, and the code set communicating on the web.

· .NET developer tool, including: Visual Studio .NET Integrated Development Environment (IDE) (Visual Studio .NET integration development environment) to develop and test applications; .NET programming language (such as Visual Basic .NET and new) Visual C #), used to create an application running under the CLR and using the class library.

· ASP .NET, a special class library that replaces the previous Active Server Pages (ASP) to create dynamic web content and web server applications, which will adopt, such as HTML, XML, and SIMPLE Object Access Protocol (SOAP). The Internet protocol and data format such as simple object access protocols.

(For the profile of the platform component, please see ".NET Development Platform" diagram.)

2. Why does Microsoft need a new development platform?

Microsoft hopes to reserve the basis of its huge Windows development users in this platform, otherwise these user groups may turn to other platforms due to the commitment of the hardware and operating system (OSS) of Java to developers. The developer itself will not bring a lot of benefits to Microsoft (or any other company for this matter). However, Windows programmers are a great support for Microsoft products (such as Windows itself), and commercial software developers have formed an important channel to serve Microsoft products to customers. If Microsoft can let developers write applications in new .NET development platforms, there will be more companies to buy Windows Server and .Net Enterprise Server (.NET Enterprise Server), including SQL Sever, Exchange, Share Point , Commerce Server, and BizTalk, etc. Microsoft is particularly loaded. Net development platforms are used to develop a new type of application: Web Services, or server applications that exchange XML format data on Web. (For the view of Web Services, please see "Web Services: What's why".) Microsoft believes that Web Services (for this company has registered a trademark called "XML Web Services") is the company will existing, isolated Applications are integrated into a larger business (and B2B) system. Microsoft hopes that Web Services has become a "must have" application type developed on new platforms and products, as desktop applications with graphical user interfaces attract programmers to develop on earlier versions of Windows. Microsoft itself also plans to use this platform to develop its own public web services (called .Net My Services), which will provide data storage and other functions to customers on the Internet.

.NET development platform

The .NET development platform is a set of software components for establishing a web server application and a Windows desktop application, running with the application created by this platform running under the COMMON LANGUAGE RUNTIME (CLR) (General Language Runtime) . The CLR is a software engine that confirms that they can do not incorrectly execute, perform appropriate secure license verification, execute the application, and then cleared them after running. Class library sets provide code that enables applications to read and write XML data, communicating on the Internet, accessing databases, etc. All class libraries are built on a base library that provides functions that manage the most frequent data types (such as numerical or text strings), as well as underlying features such as file input / output.

Web server applications typically depend on ASP.NET, a library that handles web requests. ASP.NET rely on a Web Services library for sending and receiving SOAP information, and a web user interface (UI) for receiving user input and dynamically generating web pages in a browser (sometimes called Web form) ). Windows desktop applications can display a graphics UI by using the WIN table single library (also known as a Windows Form).

Finally, Visual Studio .NET provides a graphical Integrated Development Ewironment (IDE) (Ide) (integrated development environment) for creating an application on this platform. Programmers can use one or more .NET programming languages ​​to write their code, such as Microsoft's own Visual Basic .NET (VB.NET), Visual C , Visual C # and JSCRJPT .NET, etc. A large number of other .NET programming languages ​​can be obtained from third-party manufacturers. .NET Framework core:

All applications created on the .NET development platform require two core blocks:

Common Language Runtime (CLR) (Universal Language Running Environment), this is a software engine to load applications, confirming that they can run without incorrectly running, performing appropriate security license verification, executing applications, then after completion Clear.

The .NET Framework class library provides software components that the programmer is required to write the code running under the control of the CLR. They provide a huge function set in accordance with a single ordered classification organization - from the file system to every function of network access to the XML function.

Web server applications can also use ASP .NET, which will explain the detailed explanation. Desktop applications don't need ASP .NET.

CLR has two main goals:

· Improve the stability and safety of applications

· Reduce the length of the application developer must write, and the capacity of the wrong underlying code

These two goals are similar to those such as Sun and IBM and other vendors try to solve the problem with the Java platform on UNIX and hosts. In order to solve these problems on Windows, CLR has changed fundamental changes to the programming model of loading and executing applications.

3. Web Services: What is it?

Web Services is a software component that communicates with other applications by encoding messages in an XML format and communicates with other applications through a standard Internet protocol (such as Hypertext Transfer Prorocol (Hypert Transfer Protocol)). . A web service is similar to such a Web site: no user interface, providing a service to the application instead of the user. Web Services does not receive requests from the browser and return to the corresponding web page, but receive request messages in XML format from the application, perform tasks, and then return to the application response message in the XML format.

IBM and Microsoft are unanimously promoted to use SOAP as a message standard for Web Services. A SOAP message is like a letter, which consists of a "envelope" based on XML format and "body" containing message data. The Envelope section contains a header and a series of delivery options that indicate the message recipient address. For example, encryption information).

(Microsoft likes this programming model as "XML Web Services" - using "XML" intended to emphasize its openness .-- But this model based on a set of World Wide Web Consortium (W3C) protocol standards, industry habits simple Call it as "Web Services".)

Other suppliers such as Microsoft and IBM advocate web services as programming models that communicate with interconnect applications on the Internet. These companies believe that applications connected to each other through Internet will enhance business capabilities with their collaborative suppliers and customers. By creating a Web Services layer in an existing corporate application, each organization allows external systems to call the application through the Internet (or enterprise intranet), but do not have to modify the application itself. For example, several companies are creating web services to act as the front end of the orders that reside in the host, which allows the customer's ordering system to submit orders over the Internet. As an application that is independently developed by various departments in the company to reduce the top floor of the Web Services in existing applications to reduce the IT integration fees accompanying the company's merger. Microsoft also hopes to use Web Services to enter the service provider area, providing the necessary services to pay customers via Internet. The premiere of the planned service is .NET My Services, a set of data stored by Microsoft, including personal information entered by a single user, such as a credit card number, and calendar arrangement. Desktop and web server applications, if the user's license is obtained, the information will be retrieved from the database on those Internet.

4. How does CLR work?

An application is a file or file set called a compilation into CLR. This assembly is Microsoft Intermediate Languagl (MSIL) code, and the CLR translates it into an executable native code. Since the control from the application from MSIL to the native code, the CLR can manage the execution of the application and prevent the occurrence of various problems, so there is a terminology control code.

In addition to the MSIL code, the assembly also contains metadata that describes the MSIL code correctly performs the various related data types required. Finally, the compilation also includes a list - a document listing all files and software components in the assembly, which also points to where the CLR can find other compilations with the components required to run the application.

In order to load an application, the CLR uses the assembly list to determine the correct version of the assembly required by the application. Then the CLR checks all the assembly of the application - that is, the MSIL code itself with metadata describing its metadata - confirming that the code is "type security", indicating that it only performs the appropriate operation of the appropriate data type (that is, It does not allow developers to use an integer as a function pointer), and it only has access to the memory location that can be accessed.

Next, the CLR loads MSIL in the assembly of the application, and during this process, "evidence" related to compilation is collected, for example:

· Where is it downloaded or installed?

· What function does it need (otherwise, do it need to write files or send e-mail)

· What user tries to run it?

· Is the assembly have a digital signature from trusted developers, and whether the compilation of digital signatures is changed.

Perform control code

CommON Language Runtime (CLR) (Universal Language Runtime) Components (in gray display) loads and runs applications.

(1) Class Loader loads the assembly of the application to memory. Compilation includes Microsoft Intermediate Language [MSIL] code, describing the metadata of software components in the assembly of the application, and components required for other applications.

Next, the Class Loader uses the metadata assembled by the application, trying to load the support assembly of the components required by the application. For example, it may load assembly of the graphical user interface (GUI) control required for a desktop application. Class Loader uses the Versioning Polily (Version Policy) (specified by the developer or system administrator) to determine which versions of the load it supports. For example, a Versioning Policy may require only a specific version of the GUI component, even more recent versions can be utilized. This eliminates component version issues, which exists in the Windows application in the past. (2) Once the application and the supported assembly are loaded, verifier has to check its content to ensure that it is type-safe (Type-Safe), and determines the appropriate security license for the application. This is the first step in strengthening the safety process.

(3) This machine compiler converts MSIL to controlable native code, which is a processor related code, which knows how to provide services from CLR, such as fragmentation (declaration of memory is no longer used) or CLR security The system (will enhance the security license of the application), interacting.

These evidence constitutes the security element in the .NET Framework, so that the CLR can determine whether the application is running, and what license needs to run.

Next, the CLR translates the MSIL code to the native code that the processor can perform. (Microsoft is called "controlled native code" to distinguish between "uncontrollable native code", the latter is written by C , and the CLR is not controlled.) An item The ability of Just-IN-TIME (JIT) compiled makes the CLR to delay the translation process to really need it, so that CLR avoids translation of uncommonized code. (For the illustration of this process, please see "Execute Control Code" diagram.)

Finally, the CLR monitors the operation of the translation code, and periodically empties the memory released by the application (using a process called "fragment finishing").

The benefits of CLR:

The CLR enhances the application's reliability by the following methods:

It reduces conflicts between different versions. CLR can help avoid problems that occur when installing conflict-conflicted software components on a machine - now Windows applications may fail when trying to load incorrect version components. When CRL loads an application, it uses metadata and assembly lists to make sure it loads the correct version of all components. For example, if the application needs to access the database, the CLR uses the information in the list to find and load the correct data access component. The system also allows multiple versions of components to be installed in parallel.

It reduces the number of bugs and security vulnerabilities brought about by common programming errors. The CLR monitors the code to make sure it does not have a usual programming error, which may cause the program to perform incorrect functions, for example, try to use an integer as a function pointer, forcibly put the numeric data to the location assigned to text data, or Cover the code (due to buffer overflow) when loading data. Reduced bugs from these usual programming errors means that the application is not only more reliable, but also the attacker organically multiply loopholes and weaknesses.

Enhanced security makes it more difficult to run malignant code. Because the CLR understands the identity and source of each application, it can determine if the application is allowed to perform a specific task (eg, read and write local memory or send E-mail). This adds another layer of protection to the current security model. In the current security model, the application runs in the security background of the user account (for example, all applications on the administrator machine) use administrator-level licenses. Run). Memory leaks less. If the memory and components are assigned to an application, but they are not released, which will cause the system to be run out of memory, or the system is impacted, or you need to restart, release memory. CLR's memory management and fragmentation can greatly reduce the likelihood of this problem.

The Plumbing Functions reduces the BUG and saves the time of developers. Finally, the CLR provides a number of low-level, or assembled functions associated with memory and object management, data grouping, and threads. This has not only established better reliability by reducing the possibility of bugs, but also makes programmers to focus on "Industry" code for their specific applications without having to re-implement standard Windows functions. .

Transition from Windows

Finally, a very important feature executed by the CLR is a mediation role in controlling code and unconnectable code (ie, a traditional Windows code that is out of CLR. In particular, it allows developers to combine new .NET codes with existing Windows libraries and COM components, and gradually migrate an application from the old platform to the new platform. (See "Mixed Control Code and Unconnectable Code".

However, it should be noted that the uncontrollable code is running from the control of the CLR, so it is possible to impart the application, leak memory, or open the security vulnerability by buffering overflow. One .NET application is just as strong as its weakest link - its unconnectable code.

Class library unified Windows API

转载请注明原文地址:https://www.9cbs.com/read-22647.html

New Post(0)