Type: info
         Title: new: ::comphelper::createLegacySingletonFactory
     Posted by: [EMAIL PROTECTED]
      Affected: -
Effective from: CWS dba24d


*Summary*
--------
+ <comphelper/legacysingletonfactory.hxx>
+ ::comphelper::createLegacySingletonFactory

*Description*
-------------
"createLegacySingletonfactory" creates a factory which can be used
when implementing old-style singletons

Before UNO having the component context concept, singletons were
implemented by providing  a factory which return the very same
component instance for every creation request.

Nowadays, singletons are implemented by making them available at the
component context, as dedicated property.

To bridge between both worlds - sometimes necessary to support legacy
code, which instantiates singletons at the global service manager,
instead of obtaining the property at the component context -, you can
use the function below. It creates a single-component factory, which
behaves like the old factories did: Upon multiple creation requests,
it will always return the same instance. 

Additionally, the signature of the function is the same as the
signature of <code>::cppu::createSingleComponentFactory</code> (which
creates a "normal" component factory), so you can use both factory
functions in the same context. This comes handy when your
module/library mixes new-style with old-style (legacy) singleton
implementations.
*/



Send feedback to [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to