The title is in tribute to William Gibson.
January 6, 2009
JavaScript components should avoid nsIPropertyBag like the plague
I've been bitten by this a dozen times over the years. I try to find a simple data interface for getting a bunch of strings out, and I see nsIPropertyBag. I think to myself, "Hmm. That's a pretty good choice." Then I implement it, watch it QueryInterface for my component, and then watch it not call my getProperty() method. Why? XPConnect returns its own nsIPropertyBag object first when I try to call getProperty(). So my call goes to a different object than the one I intended.
I never, ever learn.
Posted by WeirdAl at 8:29 PM
| Comments (2)
