diff --git a/mozilla/xpcom/doc/xpcom-code-faq.html b/mozilla/xpcom/doc/xpcom-code-faq.html index d270c9cb363..56e09474142 100644 --- a/mozilla/xpcom/doc/xpcom-code-faq.html +++ b/mozilla/xpcom/doc/xpcom-code-faq.html @@ -136,9 +136,8 @@ to exist. Hence the notion of getting a service not creating one. (as opposed to the notion of Creating instances with the componentManager). ServiceManager is a convenience because components can technically force singletonism by making their factory return the same instance if one was created already. -The -other big use of ServiceManager is the (still unimplemented) notion of -Shutting down a service. +The other big use of ServiceManager is the (still unimplemented) notion +of Shutting down a service.
Client
+
+
When a client knows that the component that they
are trying to instantiate is a singleton, they need to call service manager
instead of component manager. Clients dont have to worry about calling
@@ -159,6 +160,8 @@ opposed to Service Manager
+
+
When a client wants a private instance of a component,
they call the Component Manager. From the Clients point of view, a new
xpcom object creation happens everytime they call CreateInstance() Anything
@@ -170,6 +173,8 @@ a singleton
+
+
For now, the Client just has to know. There is
no way of telling which component is a Service and which isn't. In fact,
in todays xpcom (Mar 1999) any component can be accessed as a Service.
@@ -187,6 +192,8 @@ dp@netscape.com
+
+
No. The notion of the ServiceManager is available only to Clients.
Note that at some points when a component wants
@@ -215,6 +222,8 @@ become a Service
+
+
No. Again, the notion of a ServiceManager is available
only to Clients.
-
@@ -224,6 +233,8 @@ so clients can use it as one
+
+
No. There isn't a way other than a comment in the interface of the header file.
ProgID is what Clients should use to CreateInstances. Clients should
+
+
+
ProgID is what Clients should use to CreateInstances. Clients should
not even know about the CLSID unless they are hell bent on creating a particular
implementation of a component.
-
@@ -255,7 +268,9 @@ implementation of a component.
Absolutely.
+
+
+
Absolutely.
Since components are dynamically loaded only on demand, debugging them could be a hard. Here are some tips to debugging components. -+Mac: CodewarriorWindows: VC5.0 VC6.0 +
Windows: VC5.0 VC6.0
Include your component library in the Project->Settings, Additional -Dll. drop down. After that breakpoints can be enabled. -
+Dll. drop down. After that breakpoints can be enabled. Unix: gdb
Let the program run until you are sure that your component is loaded. Type Control-C. Now all symbols from your component will be @@ -274,8 +288,10 @@ available in gdb. Put your breakpoints and restart the app. Gdb will complain that it cannot set the breakpoint, and that it is temporarily disabling it, but when the *.so is loaded, the breakpoint is enabled automatically. - <Eric Van Der Poel> --Mac: Codewarrior +
I think typing "dir components" (assuming you're in dist/bin) will also +allow you to see the symbols in your stack the first time. - <Alec +Flett>
Just open the appropriate .xSYM file in the debugger; the debugger will target the library when the application is run. - <Simon Fraser>