User:Poona/reading understanding prerequisite/components

From MozillaWiki
< User:Poona‎ | reading understanding prerequisite
Revision as of 17:29, 16 May 2008 by Poona (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

A couple of things that would briefly give you some information on Components

-- Component basically is an implementation or code that is written to achieve some functionality.

-- Components basically implement interfaces. They give body to the functions defined in the interfaces.

-- Components are uniquely identified by their Contract IDs. Example of a contrace id is - @mozilla.org/browser/bookmarks-service;1

-- The file compreg.dat in your profile directory holds the names(actually it is called CONTRACTIDS) of all the components.

-- If you observe compreg.dat, you can see components(which are actually represented by their CONTRACTIDS) are mapped to CLASSIDS(a number like this - {12bb8f1b-2389-11d3-b3bf-00805f8a6670} ). These CLASSIDS are actually mapped to a module which is again specified in the same compreg.dat file. So when a component is needed, xpconnect accesses the compreg.dat file, retrieves the CLASSID for the component and then loads the module that represents this CLASSID.