Microsoft Software Development Technology Review (COM, Ole, ActiveX and COM +)

Source: Internet
Author: User

Iv. com, Ole, ActiveX, and COM +

 

Many of Microsoft's technologies, such as Ole, ActiveX, and DirectX, are built based on the COM technology. Microsoft also uses a large number of COM components to customize their applications.ProgramAnd the operating system. So what is com?

The so-called COM (Component Object Model) is a specification that describes how to establish dynamically changeable components. This SPECIFICATION provides a way to ensure interoperability, some binary and network standards that customers and components should follow. This standard allows communication between any two components without considering whether the operating environment is the same, whether the development languages used are consistent, and whether they run on the same computer. The purpose of Developing COM is to make the application more customizable and flexible.

In fact, COM does not appear as part of a separate development process. Instead, it was originally originated from Windows 3.0 in the form of objects and embedded systems. We know that ole 1 allows an application (such as Word or Excel) to display data of other applications without opening the second application. However, Ole 1 has two limitations:

· First, the embedded data cannot be edited by the application;

· Second, there is no standardized system for storing embedded information.

As a result, Ole 2 and Ole 2 were launched together with Windows 3.1. It is the first real COM technology, ole 1 does not have the features of com-it uses another technical system. Ole 2 produces a new unique data format, called a composite file. This file can contain information about all applications supported by OLE, and supports editing, updating, and printing in any working application.

However, Ole 2 still has some limitations. The most obvious difference is that you have to open a window to edit an embedded data at any time. This improvement generates a new version of OLE, called OLE automation. In addition to editing (called internal editing) within the application that calls data, this technology also adds two other improvements related to the COM technology on the basis of OLE 2; first, it provides the ability of non-C ++ development programs (such as vbprograms) to access COM, and second, it supports creation of com-based components that exist outside of composite files. Windows 3.11 fully supports automation technology.

Although this last technological improvement has brought the most lasting impact to com, the OLE Implementation of COM is still not fulfilling Mr. Bill Gate's dream of componentized software. The subsequent technological innovation turned it into reality through the vbx control, a mechanism never imagined. Vbx is some of the built-in tools in the visual baisc development environment. It was first developed by C ++, but was developed by VB itself later. Vbx is a type of DLL application with special support for use in the VB system. In a year or so, the vbx control market rapidly grew into an industry of several millions of dollars and led to the sales of VB products. Vbx has two important properties not available to previous automated servers: the user interface and its communication capability with the customer (container.

This unexpected success of vbx led Microsoft to decide to allow the com Working Group to increase the performance equivalent to vbx on the basis of automation. The result of this development process is the OCX control (a special automated DLL server), which uses COM technology to support all functions of the vbx control, it is also upgraded to a 32-bit control. Unfortunately, before OCX was available for popularization, the emergence of the Internet and Java allowed them to be transformed into ActiveX controls.

At that time, no one expected that Java and Internet would use hydrogen bombs in the WWW field to explode in the computer field. Microsoft has long believed that their monopoly in the PC software field is not challenging, but Java and Web browsers, along with the Internet, entered the personal computer software field in a brand new way, in addition, this field is controlled by Sun and Netscape, rather than Microsoft. Com becomes ActiveX, composite files become ActiveX files, OCX controls become ActiveX controls, and so on. Com-based ActiveX components add new features based on the characteristics of the Internet, such as confidentiality and security performance,CodeShort and supports asynchronous download of data. ActiveX components also have the following features:

· ActiveX adds user interfaces to the Automation server;

· The common property and property page mechanisms standardize the behavior of ActiveX controls;

· The connection point mechanism supports sending events from ActiveX controls to containers;

· ActiveX continuity solves the problem of state storage at a time.

In short, ole1, ole2, OLE Automation, vbx control, OCX control, ActiveX, and COM + are all the implementation methods of the COM concept in the Windows operating system. Today, COM has become the core component technology of Microsoft's product series:

· Internet Explorer 4 Web browsers support all ActiveX controls. In fact, it uses an ActiveX component for its display interface;

· Windows 98, a new version of Windows operating system, binds IE with the operating system. It is based on the COM technology and supports the active desktop, so that desktop components have the functions of network applications;

· Internet Information Server (IIS) is a heavyweight weapon for Microsoft to join the battle of network servers. IIS includes many powerful com-based content series, such as Active Server Page, ISAPI extension and ISAPI filter;

· Microsoft Transaction Server (MTS) is a database-oriented system. MTS adopts the COM technology to support mixed transaction processing of multiple database systems and vending machines, and simulates non-database execution methods, the transaction can be processed as a single step. The result can be "success", "failure", and "return" without data loss due to processing failure;

· Ole db is pushed back to the OLE 2 Technology of COM. It adopts the same technology as ODBC database and supports the joint work of Non-database applications and database-oriented technologies (such as MTS.

On the other hand, Windows initially used DLL to achieve code sharing at the binary level. This is also the key to running Windows programs-reusing kernel32.dll and user32.dll. However, DLL is written for the C interface and can only be used by C or a language that understands the C call specification. ByProgramming LanguageTo implement the shared code, rather than the DLL itself. In this case, the use of DLL is restricted. Although later, MFC introduced another type of MFC extension DLL binary sharing mechanism, its use is still limited-it can only be used in the MFC program.

Com solves these problems by defining binary standards. That is, com explicitly states that binary modules (DLL and exe) must be compiled to match the specified structure. This standard also specifies exactly how COM objects are organized in the memory. The binary standards defined by COM must also be independent of any programming language (such as naming modification in C ++ ). In fact, com can be implemented on Windows only by making full use of the flexibility of Win32 DLL. Com is published in the form of executable code published in the Win32 dynamic link library (DLL) or executable file (exe.

Note: COM itself must also implement an API called the com library, which provides a series of services such as the customer's query of components and component registration/anti-registration. Generally, the com library is implemented by the operating system, so programmers do not have to worry about its implementation details.

[Note] DirectX technology

To develop games on Windows, you must understand two heavyweight game APIs: DirectX and OpenGL. DirectX is an API developed by Microsoft to optimize game production. DirectX consists of multiple components: DirectDraw, directsound, directmusic, directplay, direct3d, directinput, and directsetup. It is a software that allows you to directly control computer hardware devices. It is several times faster than Windows GDI and can be used in different languages and platforms. It supports pixel rendering to advanced 3D images, from playing simple sound to digital music, from keyboard control to anti-seismic controller ...... It provides almost everything you need for your game development. Note that DirectX is based on the COM technology.

What is COM +?

It must be clear that COM + is not a simple upgrade of COM, but its underlying structure is still based on COM. COM + integrates the technical elements of COM, DCOM, and MTS, the COM component software is upgraded to the application layer instead of the underlying software structure. Through various support of the operating system, the component object model is built on the application layer, leave the underlying details of all components to the operating system. Therefore, the combination of COM + and the operating system is closer. 3. shows the relationship between COM + and MTS and COM/DCOM.


Figure 3.com+ relationship with MTS, COM/DCOM

On the other hand, COM + is no longer limited to the COM component technology. It focuses more on the design and implementation of distributed network applications. COM + inherits almost all the advantages of COM and avoids some shortcomings in COM implementation. It organically integrates the programming models of COM, DCOM, and MTS, inherits the vast majority of their features and adds new features to the original features:

· Real asynchronous communication.

· Event service.

· Scalability.

· Manageability and configurability.

· Easy to develop.

COM + indicates that Microsoft's component technology has reached a new height. It is no longer limited to a desktop system on a machine, but points to a broader enterprise intranet, and even internet connection. COM + and multilayer structure model (Windows DNA structure, see the next section) and Windows operating system provide a complete solution for enterprise applications or web applications.

[Question] will com disappear in the. NET era?

No. In fact,. NET is just an alias for com. For an experienced C ++ programmer,. NET is the evolution of COM, while Microsoft's internal. Net can be said to be "com 3.0 ". In fact, CLR is an uncompromising COM object. However, please note that. net uses a different method to compile components, so that the. NET component is obviously different from the original COM component .. NET components do not need to use the registry and Type Library, because all information about the components is included in the Assembly as metadata. However, with the help of a tool called com InterOP, the COM Object and. net objects can collaborate well: by providing software packages ,.. Net objects can access COM objects. By providing all registry keys and COM Object Construction Mechanisms, COM objects can access.. Net object.

Related Article

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.