Hi,
One of my XPCOM components make use of other XPCOM components. As I was testing it, I found it cumbersome cos of the dependencies. Then I thought of using Dependency Injection to pass in the other components in my constructor. I wasn't successful. Is it possible to pass in references of other components into your constructor?
var _foo = Components.classes["@foo.com/foo;1"].createInstance(bar);
this.foo = _foo.QueryInterface(Components.interfaces.IFoo);
For example, foo component needs bar. Can I pass in bar via foo's constructor? I tried the above but it didn't work.
Zan