Search code examples
oopcom

What is the difference between a component-oriented and object oriented language?


I came across this line in a book on WCF:

...and the languages used for writing COM components (such as C++ and Visual Basic) were at best object-oriented but not component-oriented ...

What is the difference between the two?


Solution

  • My opinion/understanding is probably wrong and I am going to shot into flames for writing this.

    Object Oriented to "me" means a way of recognizing key data models essential to the context of the problem and corresponding methods that manipulates the state of these data, also within the context of the problem. It is a pattern for organizing data. Another pattern is organizing simply on the basis of functions subdivided to manageable levels - procedural.

    Component Oriented pattern does not so much care as to how you organize your various pieces of data models but how you tie them up. That is how do they talk to each other. It could be many ways COM/RPC, Web Services (REST/SOAP) etc. That is loose coupling or tight coupling.

    And the author is just trying to say that COM capabilities were built with a language that does not provide COM facilities in-built to it :)

    My understanding is that the statement is incorrect as choice of tie-ing up the components, is an abstraction at higher level than what language like C/C++ provides. COM just provides one of the ways to tie-up the components.