What are components?
A component is similar to a micro application, that is, it is all compiled, linked and available. The application is obtained by packaging multiple such components. Each customized component can be connected with other components at runtime to form an application. When you need to modify or improve the application, you only need to replace one of the components that make up the application with a new version.
COM Components
COM, the component object model, is a specification that explains how to establish dynamic intermutation components. It provides some standards that customers and components should follow to ensure interoperability.
COM components are executable code published in the form of Win32 Dynamic Link Library (DLLs) or executable files (EXEs). The COM component must meet the following conditions:
Components are completely language-free;
Components can be published in binary form;
Components can be upgraded without hindering old customers;
COM components can be transparently reassigned on the network.
Advantages of Using Components
1. Application customization
Component architecture is essentially customizable because users can replace a component with components that better meet their needs;
2. Component library
One of the most compelling advantages of component architecture is rapid application development. This advantage allows developers to take the required components from a component library and quickly assemble them into a piece to construct the required applications, just like building blocks;
3. Distributed Components
Component architectures can simplify the process of developing such distributed applications. In fact, client/server-style applications are the first step towards component architecture. There the entire application is divided into two parts: the client part and the server part.
Summarize
COM provides a standard way to write components. Components that follow COM standards can be combined to form an application. It doesn't matter who wrote these components and how they are implemented. Each COM component can be used with other components. The key issue in implementing such dynamically alterable components is the encapsulation of information. For packaging, COM is implemented through a connection or interface between the component and the customer. Regarding the interface, I will summarize the next blog post.