Object component technology COM +

zhaozj2021-02-11  202

As early as 1997, Microsoft has announced some of Com , but in the past two years, we have always been unclear from COM . As the WINDOWS2000 is released, COM as a component technology that is fused in the operating system will be more and more widely used in the future. COM is not a simple upgrade of COM, the underlying structure of COM is still based on CoM, which is almost included in COM, Com integrates these technical elements of COM, DCOM and MTS, which upgrades the COM component software to the application layer without Then, the software structure of the underlying is, which makes the component object model on the application layer through the operating system, and leaves the underlying detail of all components to the operating system, and therefore, the combination of COM and the operating system is more close. COM is no longer limited to COM component technology, which pays more attention to the design and implementation of distributed network applications. Com inherits COM almost all advantages, while avoiding some of the shortcomings in COM implementation, combining COM, DCOM, and MTS programming models, inheriting their vast majority characteristics, adding new features Function: If COM expands the MTS security model, it allows developers or administrators to specify security controls in the method level, pass the COM object environment information, making COM security models more efficient; COM supports MTS transaction semanties, not only Complete transaction operations through Setabort or SetComplete, and COM also supports BYOT (BringyourownTransAction), which allows COM components to participate in non-MTS transaction-processed transactions; COM inherits the concept of MTS object pool, and truly implement the function of the object pool. COM not only inherits the original most characteristics, but also adds some services, such as load balancing, queue services, memory databases, event services, etc. Queue services are very meaningful for distributed applications, especially in the case where the network speed is slow, this mechanism ensures that the application system can run reliably. When the application system contains a large number of nodes but the server is busy, the client application can put their request in the queue, and then processes these requests when the server load is light; if Com provides load balancing services, it can Realize dynamic load balancing, and the load balancing characteristics of the COM application does not need to write code, the client and component programs can be implemented in a usual manner. Getting load balancing features is not implemented by programming, but by configuring load balancing of distributed applications, as the queue services mentioned above, there is also a load balance. So how do you manage in COM ? In COM , a MMC standard interface environmental management program is used. It is similar to the MTS manager, but is not exactly the same, each COM application can include one or more COM components and role information related to the application. With the COM management program, we can set the COM application and the property information of the COM component, such as the transaction characteristics, security features, etc. of the component. COM saves most of the component information in the COM directory. The COM directory consists of unity of COM and MTS's registration model and provides a management environment specifically for components. We can check or set up COM directory information through a COM management program, or you can access COM directory information over a set of COM interfaces provided by COM .

Com also inherits the security model of MTS, supports the indicative programming model, that is, developers can develop component programs as common as possible to confirm some details to the configuration time. Using COM services and management tools, developing a COM component is much easier than developing a COM component, because the COM component itself is based on the application based on COM system services, and the COM system service is also more Some basic requirements for layer applications provide many new features for applications. We can directly use these system services to avoid the underlying detail processing, reduce development costs, reduce the amount of code, and reduce the possibility of mistakes; We can also access the underlying system resources through system services, without dealing with the bottom level, making the app more reliable and robust; through the COM system service, we can also make our components or applications while getting reliability More tended to standardize. The following figure shows some differences using COM component technology and using COM write components: Figure: After using COM and COM writing components ---- COM launch, its development mode will also change, especially For C programmers, the programmer can use some illustrative statements in the compile time to set the properties of the COM component, such as CLSID, PROGID, thread model, and dual interface, etc. If these properties are not specified, the compiler will use it. Valuation. And before we support the COM components to support certain non-default features, we must implement these features by writing code, so programmers must understand the various characteristics very clear to write the correct code, this is also Realize a difficult point in COM components. And attribute-based programming models will directly write the property information of the COM component to the C source code, the instructors generate COM components, so that the programmer does not have to write the underlying processing code, because these codes are almost all components Therefore, let the development tools directly generate these code to avoid duplication of labor, which is more direct than the MFC macro and ATL template class. Although COM still has a base basis with COM and MTS, COM has added a lot of new technologies, we can use these new technologies faster, more convenient to write components or applications. Compared with COM, Com combined with the Windows operating system is more close, integrated with a lot of underlying, cumbersome work; compared with MTS, Com is more suitable for distributed applications, which provides many large distributed applications Some features that can only be used, COM will enable enterprise applications directly into the distributed application. The above code from: the source code database (SourceDataBase) Current Version: 1.0.392 Author: Shawls profile: Http://Shawls.Yeah.Net E-Mail: ShawFile@163.Net QQ: 9181729

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

New Post(0)