Components and COM

Source: Internet
Author: User

 

An application is usually composed of a binary file. After the compiler generates this application, the application will not change until the source code of the next version is compiled and the new version is released. Obviously, people do not want to see such applications remain static after release. Developers come up with a way to continuously inject new vigor into the released software. This method is component technology.

The component technology is different from the traditional object-oriented concepts of modules and classes. The previous programs are static and immutable in files after compilation. Similar to a micro-program, a component is compiled, linked, and usable. A final application is packaged with such components. In other words, custom components are connected to other components at runtime to form a complete application. After a program is released, you can modify any component process as needed.

1. advantages of using components

1.Customized Program. Because the application using component technology is composed of many small components, you only need to replace the relevant components when creating an application without changing the entire program, this greatly improves the efficiency of program customization. In addition, do not forget that the component technology allows programs to easily replace any of these components after release.

2.
Rapid Application Development.Developers can extract the required components from the complete component library and quickly assemble them into an application. Of course, all applications inevitably need some special components, but most of an application can be built with standard components.

3.
Distributed applications.The component architecture simplifies the process of developing distributed applications. The C/S architecture is the first step towards the component architecture. Distributed applications are divided into remote and local functions. If you use the component technology to implement one or more components locally, specifically responsible for communicating with the remote functional part (specifically, one or more components. Local applications do not need to know where the actual remote components are, because such an architecture is equivalent to using those components locally.

2. component requirements

A component can dynamically insert or unload an application. To implement such a function, all components must meet two conditions.

1.Dynamic Link.The ultimate goal of the component technology is to replace the component during the running process of the application. If a component cannot be dynamically linked to an application at runtime, there is no substantial difference between such a program assembly method and object-oriented technology.

2.Good encapsulation.To illustrate this, some terms are defined here. If an application or component uses other components, it is called a customer. A customer connects to other components through interfaces. If a component changes, the interface does not change, and the customer does not need any changes. If the customer changes, the interface does not change, and the component does not change; however, if the changes to the component or customer result in interface changes, the other party of the interface also needs to change accordingly. This requirement for isolating the customer and component implementation imposes the following restrictions on the component: the component must encapsulate the language used for its implementation; the component must be released in binary form; components must be upgraded without interrupting old customers; components on the network must be freely allocated;

Sancom

As the saying goes, "No rule, no square", components that divide applications into multiple parts also need to follow the corresponding standard, which is COM. The full name of COM is the Component Object Model, that is, the Component Object Model. It is a specification for how to build components and how to build applications through components. Currently, all Microsoft applications use COM technology, and ActiveX technology is established based on COM.

COMYesDescribes how to create a dynamically changeable component.SpecificationsAt the same time, it alsoYesA software organizationMethod. The COM specification is a set of documents that set standards for the component architecture. COM components consist of executable code released in the form of DLL or EXE. Components that comply with the COM specifications can meet all the requirements for the component architecture.

Not so much as what COM is, it is better to say that COM is nothing to help people better understand it.COMNoOne typeProgramming LanguageCOM describes how to write components. It is completely free to use any language;COMNoDLL. COM uses DLL to provide dynamic links to components;COMNoLike Win32
APIFunction setCOM does not provide specific functions. It only provides some common component management services. COM provides developers with methods to develop language-independent component libraries, but it does not provide specific implementation.

COM has an API called the COM library to provide component management services that are useful to all users and components. The COM library ensures that the vast majority of important operations on all components can be completed in the same way. At the same time, the COM library can also improve development efficiency and spend more time developing your own customer programs or components.

COM forces developers to strictly isolate customers and components. Such restrictions bring various benefits:

L provides a standard that all components should comply;

L different versions of components are allowed, which are transparent to users;

L makes it possible to process similar components in the same way;

L defines a robust, language-independent architecture;

L supports transparent connection to Remote components.

 

References: COM technical insider

 

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.