3 ms·
Similar to COM, are (beside OLE, DCOM, ActiveX) Gnome's "Bonobo" (component model) [1], KDE's KParts, Mozilla's XPCOM and CORBA. Apple choose KHTML over Gecko
by frik 13y ago
Similar to COM, are (beside OLE, DCOM, ActiveX) Gnome's "Bonobo" (component model) [1], KDE's KParts, Mozilla's XPCOM and CORBA.
Apple choose KHTML over Gecko for it's Webkit fork [2] because of the various cons of such component models.
[1] Bonobo is officially deprecated: http://en.wikipedia.org/wiki/Bonobo_(component_model) http://en.wikipedia.org/wiki/Bonobo_(component_model)
[2] http://en.wikipedia.org/wiki/XPCOM http://en.wikipedia.org/wiki/XPCOM
- overgard 13y agoI remain convinced that C++ warps peoples minds into things like this :-). I'll go out on a limb and say that pretty much ALL of those things are horrible.
- asveikau 13y agoI've done COM in straight C and it's not too bad. It's rather reminiscent of the Linux kernel's "operations" struct-pointers. (i.e. where `struct file` contains a `struct file_operations *` and the operations struct itself is full of function pointers - kind of like the C++ vtable concept)
- EdwardDiego 13y agoXPCOM is... yeah, it's pretty bad. Writing a Firefox plugin vs. writing a Chrome plugin is darkness vs. light.
- ehsanu1 13y agoFirefox has a new (well, it's at least a couple years old now) system that makes writing plugins not quite so painful: https://developer.mozilla.org/en-US/docs/Jetpack https://developer.mozilla.org/en-US/docs/Jetpack
- Shog9 13y agoPretty certain COM was designed with C in mind, maybe C++ as an after-thought. The differences between C++ objects and COM objects are severe enough to make it not really a lot of fun unless you limit yourself to C-like behaviors anyway (or use Microsoft's dandy language extensions to generate a crapload of boilerplate for you).
- pcwalton 13y agoThere are some advantages to COM, in that having a standard, somewhat introspectable notion of what an object is and what its lifetime is helped Firefox add cycle collection several years ago. (By contrast, leaks are harder to avoid in WebKit and Blink, because there is no cycle collector, at least until Blink lands Oilpan.) I think COM's biggest sin was doing all this stuff without language support. It's just not sensible to graft interfaces and automatic memory management onto C without modifying the language. Objective-C is basically a slightly more duck typed COM, but it's not nearly as reviled because the object model is so deeply integrated into the language.
- maxlybbert 13y agoCOM made several promises, and had it delivered on those promises, the world would be a better place. I can understand why projects tried to copy COM, only to regret it later. As noted, GNOME deprecated Bonobo even though the GNOME name was meant to emphasize the CORBA/Bonobo aspect of things (Gnu Object Manipulation Environment). Mozilla spent a lot of effort removing gratuitous use of XPCOM ( https://wiki.mozilla.org/Gecko:DeCOMtamination https://wiki.mozilla.org/Gecko:DeCOMtamination ).