Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand the background and history of the .NET Framework and COM as well as the development of the relationship

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Today, I would like to talk to you about how to understand the background and history of the .NET Framework and COM, as well as the development of the relationship. Many people may not know much about it. In order to make you understand better, the editor summarized the following. I hope you can get something from this article.

.net Framework and COM: background and History

Reusable software is not a new concept. For eight years, people have been using various forms of component object Model (COM). Facts have proved that it is the most successful reusable software model. COM introduces the concept of "components"-reusable blocks of code that combine the functions of multiple independent functions to expand into applications such as Microsoft Word.

Most developers have experienced COM capabilities deeply when using OLE. OLE is a set of functions based on COM that enable users to embed one document into another. This feature itself may not seem very attractive, but its effect is remarkable: when a user pastes an Excel document into an Word document and clicks the embedded Excel document, OLE will convert Word toolbars and menus into Excel toolbars and menus.

From the developer's point of view, COM can provide code reuse capabilities by introducing several well-defined interfaces, such as iUnknown, through which development-time tools can query the functionality of a component and add these functions to the tool. It's like Visual Basic? Controls in the development system toolbox can be dragged to a form. In fact, each control represents hundreds or even thousands of lines of code, which can be easily encapsulated in a "black box", and developers only need to call its function directly.

One of the problems that developers find inconvenient when using COM is that they have to write additional code to convert business logic programs into reusable components, and many interfaces must be implemented to make this transformation. Most importantly, COM requires developers to deal with complex issues manually, such as emptying the memory of components that are no longer in use, calculating the number of times components are used, establishing or undoing threads and processes, and dealing with versioning issues.

Some people may think that the idea of letting developers do this kind of work themselves is very good, but it also has several drawbacks. First of all, it is very difficult for developers to perform all of the above, and it is often error-prone: leading to application errors, system crashes, and terrible "DLL Hell". In addition, strictly writing all this additional code will reduce the developer's productivity and lead to a delay in the launch.

This pair uses Visual Clearing tools? This is especially true for developers who develop systems. For developers using Visual Basic, this situation is not very serious. Visual Basic abstracts and simplifies many concepts of COM and is the development environment of productivity and productivity all over the world, but its limitation is that some functions of COM have to be shielded from developers in order to achieve this high productivity.

The .NET Framework, introduced by Microsoft at the Professional developers Conference (PDC) in 2000, automatically performs "intelligent stitching" in the software writing process, allowing developers to focus on writing business logic without having to write the basic structure of COM.

What is the .NET Framework?

The .NET Framework is a multilingual component development and execution environment that consists of the following three main parts:

The common language runtime. This name does not accurately reflect its full functionality. In fact, the common language runtime plays a very important role in the development and operation of components. While the component is running, the runtime is responsible for managing memory allocation, starting or deleting threads and processes, enforcing security policies, and meeting the current component's needs for other components. During the development phase, the role of the runtime has changed somewhat: compared to today's COM, the runtime is much more automated (such as automating memory management), so the developer's job becomes very easy. In particular, the mapping feature will drastically reduce the amount of code that developers write to convert business logic programs into reusable components. The concept of runtime is nothing new to programming languages: virtually every programming language has its own runtime. The Visual Basic development system has the most obvious runtime (named VBRUN), Visual Cellular developers? There is a runtime, MSVCRT, like Visual FoxPro?, Jscript?, SmallTalk, Perl, Python, and Java. The key role of the .NET Framework is that it provides a unified programming environment across programming languages, which is the fundamental reason why it is unique.

Unified programming class. The .NET Framework provides developers with a unified, object-oriented, hierarchical and extensible set of class libraries (API). Today, C++ developers use the Microsoft base class library, while Java developers use Windows? The base class library, while Visual Basic users use the Visual Basic API set. Simply using it, the .NET Framework unifies Microsoft's current different kinds of frameworks. In this way, developers can program smoothly without having to learn multiple frameworks. Much more than that, the .NET Framework implements cross-language inheritance, error handling, and debugging by creating a common set of API across programming languages. In fact, all programming languages from JScript to C++ are equivalent, and developers are free to choose the ideal programming language.

Active server page (ASP+). ASP+ is built using the programming class library provided by the .NET Framework, which provides a Web application model that consists of a set of controls and a basic structure. With it, building Web applications becomes very easy. Developers can directly use the ASP+ control set, which encapsulates common widgets for the Hypertext markup language (HTML) user interface (such as text boxes, drop-down menus, and so on). In fact, these controls run on the Web server, and they convert the user interface to HTML format before sending it to the browser. On the server, the control is responsible for providing Web developers with an object-oriented programming model that provides rich functionality of object-oriented programming technology. ASP+ also provides some basic structural services, such as session state management and process restart services, which greatly reduce the amount of code developers have to write and greatly improve the reliability of applications. ASP+ also allows developers to provide software as a service. By using ASP+ Web services capabilities, ASP+ developers only need to do simple business logic programming, while the ASP+ infrastructure is responsible for providing services through simple object access Protocol (SOAP).

The relationship between .NET Framework and COM

One of the main goals of the .NET Framework is to make COM development easier. One of the most difficult things in COM development is dealing with the basic structure of COM. Therefore, in order to simplify COM development, the .NET Framework has automatically handled all tasks that developers consider to be closely related to "COM", including reference calculation, interface description, and registration.

It is important to realize that this does not mean that the .NET Framework component is not a COM component. In fact, COM developers using Visual Studio 6.0 can call .NET Framework components, and in their view, the latter is more like a COM component with iUnknown data. In contrast, .NET Framework developers using Visual Studio.NET treat COM components as .NET Framework components.

To avoid misunderstanding, this relationship needs to be highlighted here: COM developers must manually do what most .NET Framework developers can do automatically at run time. For example, the security module of the COM component must be handwritten, and the memory consumed by the module cannot be automatically managed, and when the COM component is installed, the registration entry must be placed in the Windows registry. For the .NET Framework, the runtime automates these functions. For example, the component itself is self-describing, so it can be installed without registering in the Windows registry.

The relationship between .NET Framework and COM+

When COM is combined with Microsoft transaction server (MTS) and distributed COM (DCOM), it becomes COM+. COM+ provides a set of services oriented to the middle tier. In particular, COM+ provides process management functions and database and object connection pool processing functions. In future releases, it will also provide a feature called partitioning-a more powerful process isolation feature designed specifically for application service providers.

COM+ services are mainly developed for middle-tier applications and provide reliability and scalability for large-scale distributed applications. These services complement the services provided by the .NET Framework, which can be accessed directly through the .NET Framework classes.

After reading the above, do you have any further understanding of how to understand the background and history of the .NET Framework and COM and the development of the relationship? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report