Hey folks, this is just an unofficial announcement that nsISupportsArray is more or less deprecated.
But don't panic. What this means is: * its use is forbidden in public (frozen) interfaces.. public interfaces should use nsISimpleEnumerator or nsIArray (as yet unimplemented, see http://bugzilla.mozilla.org/show_bug.cgi?id=162115) * it will probably stick around forever anyway, so you can still use it internally in your objects, as member variables, and in private, unfrozen interfaces. * No, there will be no tree-wide sweep to move people away from nsISupportsArray And now a FAQ of sorts: Q: Why is this happening? A: Nothing is actually happening, to be honest. Over the last year or two, we've been switching interfaces over to nsISimpleEnumerator on an as-needed basis, as we freeze them. Most to-be-frozen public interfaces don't use nsISupportsArray anyway. Q: But.. my code.. it depends on nsISupportsArray! A: That's not a question, that's a cry for help. But that's ok, I'm right here, holding your hand. Keep using it. Change over when you can. There's no rush, no compelling need to switch to nsISimpleEnumerator or nsIArray. It only affects interfaces that are going to freeze. Q: What do I need to do? I don't have time for this crap! A: First, you need to chill. This is no big deal. Second, when writing NEW interfaces or adding array-like accessors to existing interfaces, you should TRY to avoid using nsISupportsArray, on the off chance that your interface might be frozen some day. A few minutes of time using the right interface now will save you or someone else hours of work down the road, converting consumers of your interface. Q: What's nsIArray? Can I use that? What's the difference? A: nsIArray and nsIMutableArray from the bug listed above are simply clean, fresh interfaces instead of the muddle of methods that is nsISupportsArray. The syntax will be very close to nsISupportsArray, including QueryElementAt and so forth. See the bug for the current proposal. One bonus is that nsIArray will also allow you to return syntactically "immutable" arrays (in that the array itself is immutable - the elements in the array are not, and nothing is preventing someone from QueryInterfacing to nsIMutableArray) Q: When will nsIArray be available? A: Sometime early in the 1.2beta cycle - we need it to freeze a few interfaces that MUST be frozen by the 1.2 release. Please follow-up to netscape.public.mozilla.xpcom and I'll answer questions there. Thanks Alec
