nsIServiceManger Changes

I have posted a proposed patch in bug 99147 which will effectively 
freezes the interface nsIServiceManager with all of the changes 
suggested over the year(s).

The old, nsIServiceManager has been renamed and preserved as 
nsIServiceManagerObsolete.  And as the name suggests, this interface 
should not be for any new development.

The major changes to the nsIServiceManager are:

1. the interface is represented in IDL.  The service manager was written 
before we had the xpidl compiler, so it is just a header definition. 
There has been much desire to move things to xpidl for many of its benefits.

2. removed registerService and unregisterService. This is a duplication 
of functionality, as Factories do this job quite well.  One can register 
a factory and have that factory return the singleton object.

The current "registerFactory" is on the nsIComponentManager.  I plan to 
change this for bug 98553.  I will probably move this explicit 
functionally into a new interface.

3. added isServiceInstantiated and IsServiceInstantiatedByContractID 
which can tell you if service has been instantiated (e.g.. calling 
GetService* will not result in the service being created).

4. added a new plugin "C" API to return the service manager: 
NS_GetServiceManager.  This will be the *one-true-way* to obtain the 
service manager if it is not passed to you.

Naming of this interface:

There is some going back and forth about what the name of this new 
interface *should* be; either nsIServiceManager - renaming the 
'original' interface or nsIServiceManager2 - saving the 'original 
interface.  I have gone with the former as I prefer it.  I can be 
convinced otherwise.


Comments welcome, here or in the bug.


doug turner
[EMAIL PROTECTED]


Reply via email to