Microsoft .NET

zhaozj2021-02-08  218

Author: A New Summary: .NET is Microsoft's plan following the launch DOS, Windows yet another revolutionary development platform. A large number of new concepts and new technologies are proposed throughout the .NET framework. This article describes the .NET framework from the perspective of software development, and compares .NET and J2EE, and some questions from .NET. Keywords: .NET, XML (Scalable Markup Language), SOAP (Simple Object Access Protocol), WindowsDNA, Collection (Assembly), Universal Language Runtime (CLR), IL (Intermediate Language), metadata, Namespace, C # 1, preamble What is .NET? Different people have different explanations. Some people think that .NET is a new next-generation visual development environment; some people think that .NET is a new language for the Internet - C #; some people think it is based on XML (Scalable marker language) and SOAP (Simple Object Access Protocol) The new information exchange platform is a future-oriented enterprise development platform. Some people think that .NET is only the evolution of WindowsDNA technology. There are many definitions like this, and these statements are all right, but they all involve part of .NET. First, it should be sure that .NET is a technology revolution. In today's society, technological advances have happened every day, but the revolution is not often there. In Microsoft's history, from DOS to Windows32 is a technology revolution, from Windows32 to WindowsNT, it is also a technology revolution. With the rapid development of the Internet, the difficulty of software development is gradually increased, and the existing development platform and development environment and technology are increasingly unable to meet the web-based applications in the Internet age from development techniques. Programs and web services are in this environment, Microsoft launches .NET, can not exaggerate, .NET is a revolution. In the in-depth discussion of .NET, we can understand this. Second, the composition of the .NET framework is shown in Figure 1, the .NET framework consists of many aspects, the most important of the entire structure is a system service and a common language runtime (CommON language runtime). Among them, there are many services that provide a lot of services to simplify the development of the code (deployment), while also providing a lot of services in terms of reliability and security. The .NET framework also includes a series of basic class libraries that can be used for any .NET-based programming language, which will find the reuse of the code level on this basis. At the top of the frame, .NET provides a series of components (Note: In .NET), use a collection (askEMBLY) instead of components more appropriate), greatly enriches the development, whether developing Windows-based applications, or Develop web-based applications. First discuss the collection (Assembly), from the surface, it seems that the concept of the collection is not mentioned in the .NET framework, but the actual collection is ubiquitous, and the collection can be considered managed components. In the current development mode, the code generates an EXE file or DLL file after compiling, which are for a particular CPU, which exists directly in the machine code. The disadvantage of this approach has made almost everyone taste the bitter --- DLL traps.

In actual life, it is often encountered. After upgrading a version of a DLL, it is found that some of the original versions of the original version have problems, and even have problems such as memory conflicts, crashs. In the collection, since the generation of code is in the form of intermediate language (Intermediate language), it is not based on any special CPU platform, and the metadata is automatically generated when generating a collection, this metadata is in the collection. In the form of a manifest, metadata can self-describe the components, through metadata, what types of components can be known, which resources are available. Contains a collection of version numbers, etc. in metadata. With such an assembly - a collection, there will never have a similar problem such as a DLL trap. Therefore, the collection is the foundation of .NET version control technology, the emergence of collecting technology enables developers and managers to strictly implement version-dependent policies between different applications, because the collection can be self-description and self-explanation. It is also possible to achieve a real connectionless installation. Due to the self-description of the collection, the concepts such as the registry will be out of date. Under the .NET platform, all program installation will become copied, and severe registry spam will not exist. On the other hand, due to the minimum unit of components that can be used, it also has a very important role in the security field of .NET. Let's talk about the system service, including a large number of basic classes within .NET, which exists in the aggregate. Each basic class defines some of some .NET platform potential attributes. The base class similar to the property is included in the same space (Namespace). In the namespace, the most commonly used namespace is the system name space. The classes included in the system namespace are based on the base class, and there is a bit like the role of the COBJECT class in the MFC. In addition, the system namespace also includes an exception handling, garbage collection, console input and output, etc. a series of important features. Overall, if you want to use any features of the .NET platform, you need to interact with the namespace and the classes you have. For developers, you can derive your own class and name space on the basis of these namespace. Using a large number of services provided by system services, developers can develop Internet-based programs with higher efficiency, faster speeds. In the entire .NET framework, from a technical point of view, the most important concept is the common language runtime, and below is represented by CLR. If the system service looks into the basis of the .NET framework, the CLR can be seen as the core of the .NET framework. For software developers, it is understood that the key to .NET is to understand the CLR geographical solution. For Windows developers, whether it is C Runtime Library or MFC or more, Java Virtual Machine, is more or less. In fact, the Windows operating system itself can be considered to be running and library aggregates. Running and libraries are served for applications to a certain extent, which greatly saves time and is conducive to the reuse of the code. Comparing COM's programming mode can better understand the CLR programming mode. For COM, its programming idea is based on type rather than file-oriented. At this point, the CLR is also used. In the earliest Windows programming, when you need to call a DLL interface, you generally use the loadLibrary function, then call the getProcAddress function. With the appearance of COM, the COCREATEINSTANCE and QueryInterface functions have changed all. CLR is also centered on type. Although the CLR is like CLR in programming mode, it is not the same in implementation.

The CLR overcomes some of the shortcomings inherent, such as type information format, and private type information cannot be contacted. First, the concept of components in CLR becomes a first-class citizen. In COM, there are many ways, objects, classes, and dynamic connection libraries can represent components; and the concept of components in the CLR is in the form of assembly (for each type, COM adopting The 128-bit UUID is defined, while in the CLR to better ensure uniqueness, 128-bytes of public keys and the only type name remaining unique in the local range are used to provide global unique representation. When a client application calls a collection, there is a 64-bit public key Hash value in the client application, so that the collection being called is the correct collection. Second, for CLR, only one metadata exchange format exists. In COM programming, you need to define type information in the IDL, and then use a specific language (C or Java) to implement. Developers in CLR can define and implement this type in any language. Third, metadata is completely scalable. Any language can extend the type information of the CLR. Fourth, there are two types of systems, IUNKOWN and Variant types in COM; all types in the CLR are from System.Object. Fifth, the multi-inheritance of the interface is allowed in the CLR. All in all, just if you don't understand COM technology, you can't really understand Windows, understanding CLR is very important for understanding .NET. In fact, from a certain point of view, the CLR is a huge leap in COM. Third, .NET new features .NET is a new technology, so .NET also includes a lot of new features. There are only some important features here. (1), consistent programming mode In the .NET environment, all applications use universal object-oriented programming mode, which is no longer like a Windows environment, both DLL functions also have a COM object. (2) Simplified programming mode This may be the message that the developer is happy, in the .NET environment, due to the role of the CLR, no longer need to master the headache for Guids, IUNKNOWN, AddRef, etc. COM knowledge. (3), running in multiple platforms for any operational platform, as long as the .NET application can be running .NET application. Now all Windows platforms can achieve this. In the future, you can even run on a non-Windows operating system. (4) Support for multi-language synthesis according to COM, code reuse is based on the level of binary code. In the .NET environment, the code reuse can be built at the source level, that is, some classes written in C # language can be used directly in the language of C . The reason why .NET has such a huge power lies in .NET provides a set of universal type systems for all languages ​​for all support .NET programming. (5) Automatic resource management can not be exaggerated, and the most headache of all developers is the memory leak problem. In the .NET environment, this issue is completely resolved, and the automatic resource management function has been added to the CLR. At the same time, due to the addition of resource recovery functions, security is also guaranteed to a certain extent, such as memory overflow attacks, will be effectively controlled. (6), the consistent error handling method believes that all WindowsSDK programmers are bored by the chaos in the Windows environment, WIN32 error code, exception, HRESULT, etc. All programs in the .NET environment use a unified error handling method --- produces an exception.

(7) If we already know, the appearance of .NET is to meet the enterprise calculations in the next-generation Internet environment, the general access control can no longer meet its requirements, so in terms of security. Net relative For other systems such as Windows, there is a more in-depth improvement. From the start of a class, confirm check; when accessing the code and the corresponding resource, the code access security measures are implemented. .NET provides a set of mechanisms to determine roles and confirm identity information, and can make cross-trip and machines to ensure that the required code is not damaged at the far end. The security of .NET is also deeply embedded in the CLR structure to ensure the security of the application itself. These security mechanisms are a qualitative extension of existing operating system security mechanisms, compared, .NET has been further strengthened security. (8), the introduction of XML and SOAP, the design of the distributed application, the past we design two-story application, there is a protocol such as CORBA, IIOP, RMI, and DCOM. People are already familiar with such a distributed system. However, the drawbacks of such a distributed system are poor flexibility because this design is designed to secure the application to the server. The Internet is a loose connection, very distributed world. The original Client / Server structure has passed, which puts a new programming mode, while XML and SOAP can make this model work well. In .NET, XML and SOAP have deeply dissolved into it and become a very important part. (Nine), the new programming language C # With .NET's launch, Microsoft has also strongly launched a new type of programming language C #. C # is as simple as VB, and it is as strong as C . In the eyes of some people, C # is a Java replica. This kind of saying seems to have some truth, because C # is like Java. But correctly, C # is never java clones, C # launches the language launched on the basis of C, C , Java, Modula2, SmallTalk, etc., compared to Java, C #, the biggest difference It is closer to C , and C # also absorbs a lot of new concepts, such as C # is a component-oriented language, C # can make the maximum integration with the XML protocol. At the same time, C # is very different from Java in compilation. The launch of C # is closely related to .NET is closely related. Fourth, .NET and J2EE comparison in the computer world, new technologies continue to appear. The following J2EE and Microsoft's .NET launched in Sun is more computing in the next generation of enterprises. The J2EE platform provides a component-based approach to design, develop, assemble, and deploy an enterprise application. The J2EE platform provides multi-layered distributed application models, components reuse, uniform security models, and flexible transaction control. At the same time, ensure your platform is independent, component-based J2EE solutions are not bound on any manufacturer's products and API. Through the above discussion we can see that .NET and J2EE should be very similar to the starting point of design new technologies. However, these two technologies have a large difference between implementation methods and specific implementations. The first thing to indicate is that .NET is not a simple modified Windows operating system. Because of Microsoft's design idea, any operational platform can run the .NET program as long as the CLR is installed. 1. On the development language, .NET support surface is relatively wide, C , VB, C #, Perl, COBOL, etc. are supported, and developers can easily find the language suitable for them. J2EE only supports Java language. This is to say that J2EE is relatively narrow on the selection surface of the language. Of course, C # is the most important language supported by .NET, with respect to Java, C # is a Just-in-Time compilation, while Java is based on interpretation.

At the same time, Microsoft provides different JIT compilation methods for different platform environments. For mobile computing environments similar to Windows CE, Microsoft provides compressed .NET framework, correspondingly provides ECONOJIT (Economic compiler). In a general desktop environment, Microsoft provides a standard compiler. On the other hand, C # will become an industrial standard because the ECMA (European Computer Manufacturers Association) is accepting C #; and Java language is just SUN. 2, J2EE supports Java, EJB, and .NET supports XML / SOAP. From standard openness, XML / SOAP is better than the former. XML is proposed by the W3C organization. It has been supported by many manufacturers. It is the standard representation of the next generation Internet, and XML can effectively express various knowledge on the network, providing new vectors for information exchange and calculation. The XML relative to the role of the network calculation can be compared to the computer starting phase ASCII code. XML can also be said to be a standard code for network information, which is not a symbolic information, but a knowledge of knowledge. This standard language is not a programming language, but it represents the bright future of next-generation network. Speaking here, it is not allowed to remember that people "the year" to Java's fanaticism. Indeed, Java has a very attractive original intention to make many people in such an ideal call to invest positively to the interoperability of various systems in the imagination. But in fact, Java has neither a successful commercial computing tool in people's imagination, and does not substantially technological progress. Java tries to achieve interoperability from the perspective of the unified computing platform, but this may always be a dream. Three virtual interoperability can only be standard and universal data description languages. The SOAP protocol itself is also jointly introduced by Microsoft and IBM's business giants. All this shows that the openness of the .NET technology standard is good. 3, .NET SOAP protocol ensures that components on one platform can exchange information with components on the .NET platform. 4, the most important point is that under the existing conditions, a variety of so-called cross-platform, "compiled once, multiple operation", etc., etc. are just commercial speculation. James Goslin, chief designer James Goslin, who has expressed this, the so-called "compiled once, run" slogan is just a beautiful idea. That is to say, it is inevitable based on a development platform. If you use the Java's WebSphere to use Java development business programs, it is basically fixed on this platform. The 100% pure slogan known as Java is not the case; of course, C # is also the case. 5, an important benefit of developing programs on the .NET platform is that real "code reuse" can be realized. Because of the design .NET platform, an important thinking is to run at runtime and specific language. All resource management, memory allocation, variable types, etc. are processed at runtime, in which class written by C # can be used directly in the C / C program. In this case, as long as the .NET platform, the past procedure does not make very much modifications because of the new language. On the J2EE platform, Java is Java, which will mix together when running and specific languages. All in all, J2EE and .NET have their own advantages and disadvantages. Both are excellent platforms for very good development enterprise computing software. But as different people have different hobbies, in the future development, it is still necessary to determine specific application platforms according to their specific needs. V. Some questions about .NET have passed the above analysis, we can feel that .NET is indeed a technology revolution. But after the study, it will still have some questions to .NET.

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

New Post(0)