extending mailnews objects

David Bienvenu bienvenu at davidbienvenu.org
Tue Jun 8 14:19:49 UTC 2010


  On 6/7/2010 4:06 PM, Kent James wrote:
>
> My question is this: Is there any strong reason to prefer one over the other? And if forwarding makes sense, could I have a general agreement that patches would be 
> accepted in comm-central that allowed creation of XPCOM objects that implemented the base objects?
I've always found forwarding somewhat awkward in practice - debugging is a bit more painful, you've got an extra reference to worry about, etc. But that's really more your 
problem and yeah, I'm OK with having contract id's that create the base objects like nsMsgDBFolder, nsMsgIncomingServer, etc. I think we have very few if any pure virtual 
methods.
>
> As a specific example, I ran into some problems using inheritance with the nsMsgDatabase extension, because I ended up with multiple copies of static variables defined in 
> the base file. I solved that problem by switching to forwarding. I also believe that my extension DLL files end up with their own copies of the object code for the base 
> classes, which seems to bother me (and was the root of my nsMsgDatabase problem). But perhaps that is just a linking issue?
I'd like to solve the problems you're having with the inheritance model, especially if they're all as trivial as the nsMsgDatabase problem.

- David



More information about the tb-planning mailing list