User:Poona/reading understanding prerequisite/components: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(New page: 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. '''...)
 
No edit summary
 
Line 2: Line 2:


'''--'''  Component basically is an implementation or code that is written to achieve some functionality.
'''--'''  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 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
'''--'''  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.
'''--'''  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.
'''--'''  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.

Latest revision as of 17:29, 16 May 2008

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.