When calling an XPCom component from Javascript we can use to functions: getService() and createInstance().
* getService() will get a singleton class, so a single object will do all the work no matter how many times you call it.
* createInstance() will create a new instance of that class, this is useful in situations where you make asynchronous requests, or process things in parallel and you don’t want all of it to be processed by the same object.

Example:

var file = Components.classes["@mozilla.org/file/directory_service;1"]
.createInstance(Components.interfaces.nsIProperties)
.get("ProfD", Components.interfaces.nsIFile);
var file = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties)
.get("ProfD", Components.interfaces.nsIFile);