The last few months I’ve tried submitting patches to Mozilla implementing some feature as a XPCOM component, I’ve been told XPCOM’s the wrong way to go. I don’t understand why, though.
A lot of my work – especially Verbosio – has been based on the idea that JS components work. I can clearly define the interfaces in XPIDL, with some type checking done for me by XPConnect. Ditto for scriptable C++-based components, which I write only when I feel I have to.
I’d really like someone to write a DevMo or WikiMo article (or failing that, a blog post), explaining best practices, the costs of XPCOM, and alternatives. There’s several areas to cover:
- C++ to C++
- C++ code called from JS
- JS code called from C++
- JS to JS
- Privileged code called from content (not escalating content to privileges, just code that runs with privileges but exposed through some public interfaces to content)
- Anything obvious that I’ve missed.
(I know I sound like a jerk in this article, and the tone is a bit hostile. I apologize for that, but as usual, I’m having trouble editing my own words… I can write new words, but which ones?)
P.S. Thanks for all the replies to my previous post… very informative, very useful opinions!