What is COM

Source: Internet
Author: User

1. What is COM
COM (Component component Obiect object model), is a set of language-independent, binary, object-oriented, reusable component specifications.
.
2.COM objects
In the COM specification, there is no strict definition of COM, which the COM component provides to the customer is an entity encapsulated in object form, and the entity that the customer interacts with is a COM object.   COM objects have their own properties and methods, but these are encapsulated by COM, the client only through the interface to the COM method to call, the interface is COM to communicate with the outside world, the only way to interact. The concept of COM pairs of images is somewhat similar to the concept of objects in C + +:
3.COM interface
The COM interface is the most important part of the COM specification, the core of the COM specification is the definition of the interface, and even the "interface in COM is everything." The component interacts with the component, between the component and the customer through the interface. The interface member function will be responsible for servicing the customer or other components. Like the CLSID that identifies a COM object, each COM interface is also identified by a GUID, which is also known as the IID (Interface Identifier, interface identifier)-language-oriented object programming-class concept! Object-oriented programming is currently the most popular programming method, support object-oriented programming language is also many, common Vb/c++/java and so on, these object-oriented programming languages are English programming. Based on all-Chinese programming, the easy language has been fully supported in object-oriented programming since the release of version 3.8. This paper introduces some basic concepts of object-oriented programming, and finally learns to write an object-oriented programming program using easy language. The concept of class to understand object-oriented programming first to understand the concept of classes. Classes and objects are two distinct concepts, so do not confuse classes and objects. A class can be considered an active type, which is defined by the programmer itself and defines the content structure of that type, including the definition of data and behavior in that type. The behavior of the type is called a method of that class, and the variable that holds the various data in that type is a private member of that type. The above definitions may be abstract and difficult to understand, classes can be simply seen as encapsulating a variety of data and methods of the module, but the class is a lot of unique personality, but also an important part of the face of object programming. An object is an instance of a class. If the object is compared to the house, then the class is the design drawing of the house. So the focus of object-oriented programming is the design of classes, not the design of objects. In easy language, to create a new class, you can use the menu "Insert" → "class module" to implement. You can also select the "New class module" option in the pop-up menu by clicking the right mouse button on the program data item in the Programs panel. After the inserted class, the "_ Initialize ()" Method and the "_ Destroy ()" method are automatically generated, both of which run automatically when objects based on that class are created and destroyed. These two methods, equivalent to constructors and destructors in other object-oriented programming languages, are used to initialize objects and destroy objects. For example, you can set the initial values for each private member in "_ Initialization ()", and you can write some work that needs to be done in the "_ Destroy ()" method, such as closing a file, shutting down a database, and so on.
Constructors and destructors are written manually by programmers in many other object-oriented programming languages. The automatic generation of these two functions in the easy language undoubtedly relieves the programmer of the burden.

What is COM

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.