COM vs OOP

Started by
8 comments, last by Pavel Krupets 23 years, 6 months ago
COM is much slower than OOP class? Do anyone use COM in games?
Advertisement
I am no COM expert, but as far as I know, a COM interface is just like a pure virtual class.
The overhead of COM is that you always have to communicate with COM objects through interface pointers and virtual function calls.

/ Tooon


But I think no one use COM in games...

thx...
Whatabout if you use DirectX?
I also think DirectX is totally COM based.
COM is OOP-oriented... it is virtual classes that you use to make an interface for objects. I just don''t see why the "vs" in the title... It''s not a battle, like C++ and C. One complement the other, that''s all.

In games, you don''t need COM because it is too slow anyway. But you may need DCOM for network games for example, if you don''t want to make a complicated way to share infos on network.

Now I know what I''m made of, and I''m afraid of it...
Now I know what I'm made of, and I'm afraid of it...
I know about DirectX thanks.
They wrote all classes/interfaces from zero.

But some people even don''t use OOP they use pure c.
(Karmak for ex. Quake 2) I don''t know anything about Quake 3 and other developers.

Used properly, calling a COM function is no slower than calling a function from any other DLL. (Though they tend to accept more arguments than most other self-respecitng DLL functions) COM is also used in games. Activision has a nasty habit of encapsulating much of its code in COM objects. ("I saw the code and lived!" was the motto on the call to power hacking contest)

And using pure C doesn''t mean you can''t use OOP. It just means that the glue is out in the open rather than tucked out of sight.
What das "using COM" actualy means??
If I use one pure virtual class, and than make virtual_class=new some_other_class; And if I don''t use IUnknown interface (QueryInterface,...). Does this means that I use COM??
COM refers specifically to the Componenet Object Model, which is a binary standard for interfacing with software components. If you implement the binary standard for interfacing with your software component, then you''re using COM, no matter what language you''re using, C, C++, even smalltalk. If you don''t implement the binary standard then you aren''t using COM. So you must have IUnknown, reference counting, vtables, etc. in order to be considered using COM.

This topic is closed to new replies.

Advertisement