What is the Component Object Model (COM)? Is it language-dependent?

后端 未结 4 1866
灰色年华
灰色年华 2021-01-30 18:45

I\'m new to COM, and I don\'t know what it is or why it exists.

Is this a programming methodology like OOP? Do programming languages have to support it? (with some speci

4条回答
  •  别那么骄傲
    2021-01-30 19:25

    COM at its core is a way of providing a data-passing contract which is independent of any specific language. It is provably not language dependent, as there are many languages which support COM (there are C++, C, .NET, and Java implementations)

    In practice it is useful for a couple of different examples:

    1. Communication between different languages: Because COM is language independent, it is possible to use COM to pass data between components in different languages. For instance you can use COM to talk between C++, Java, and .NET code.
    2. Threading Semantics: COM allows you to define threading semantics for a particular component to ensure it is created in the appropriate thread context no matter where it is used.
    3. General componentization.

提交回复
热议问题