Component Loaders

Brendan Eich <brendan@mozilla.org>
John Bandauer <jband@netscape.com>
Mike McCabe <mccabe@netscape.com>
Mike Shaver <shaver@mozilla.org>
Suresh Duddi <dp@netscape.com>

Scope of document

Why Component Loaders

Currently XPCOM requires all component to be packaged in DLLs and uses the dynamic loading mechanism available with each platform to accomplish instantiation of component. This method doesn't blend well with say components written in java or javascript and packaged different from a DLL. Hence the proposal for Component Loaders.
 

Component Loaders

XPCOM in its simplest form can be viewed as creating instances of objects given a CONTRACTID or ClassID. How it does this instantiation is specific to XPCOM and opaque to clients of XPCOM.

Internally XPCOM maps the passed in CONTRACTID to a CID and then the CID maps into a DLL name. XPCOM loads the DLL assuming the dynamic loading mechanism to create a factory. Then, asks the factory to create a particular instance. Here are roughly the steps involved:

  1. CreateInstance(..., CONTRACTID,...)
  2. Map CONTRACTID to CID
  3. Map CID to DLL
  4. factory = Dynamically Load DLL to create Factory
  5. Use Factory to create object instance
The proposal for Component Loaders is to get XPCOM to delegate the loading to a component loader:

Autoregistration of non DLL Components and Component Loaders

<Need to figure this out>
 

* ContractID syntax might change



Last Modified: 1 Aug 1999  Suresh Duddi <dp@netscape.com>