singleton or maybe not ? 
Author Message
 singleton or maybe not ?

Hello,

I'm implementing the DOM (just like MSXML)

For those who know, there's a DOMImplementation interface, which can be
accessed by document.documentImplementation

The way I'd like to implement this DOMImplementation is on an object that is
common for all documents.

My program is a DLL, and I've heard that singletons don't work with DLLs,
What I would like though is that there's only one DOMImplementation object
for each client of the DLL.

I don't know how MSXML has done it, but in all their examples, they always
create a document first and access the DOMImplementation through the
document, that's not really what I want, as the DOMImplementation also has a
createDocument method, so it really should be the other way around.

Any thoughts?

thanks,

--
Sigurd Lerstad



Wed, 13 Jul 2005 03:41:00 GMT  
 singleton or maybe not ?
COM Singletons (using declare_classfactory_singleton(x)) won't workin DLL
but you can put your implementation in a class. Write your own class factory
and make it to instantiate you Implementation class. Your implementation
class can be a Singleton (check GoF Singleton pattern)

HTH


Quote:
> Hello,

> I'm implementing the DOM (just like MSXML)

> For those who know, there's a DOMImplementation interface, which can be
> accessed by document.documentImplementation

> The way I'd like to implement this DOMImplementation is on an object that
is
> common for all documents.

> My program is a DLL, and I've heard that singletons don't work with DLLs,
> What I would like though is that there's only one DOMImplementation object
> for each client of the DLL.

> I don't know how MSXML has done it, but in all their examples, they always
> create a document first and access the DOMImplementation through the
> document, that's not really what I want, as the DOMImplementation also has
a
> createDocument method, so it really should be the other way around.

> Any thoughts?

> thanks,

> --
> Sigurd Lerstad



Tue, 12 Jul 2005 13:08:07 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Singleton not a singleton?

2. ATL Singleton and Singleton Class also from C++

3. Maybe I did not quite understand you

4. This should work ... or maybe not :)

5. Singleton EXE Server not shutting down

6. Why is function static singleton not thread-safe?

7. new Singleton() ( Can I override the new operator to return a singleton?)

8. how can I change the encoding in the output??(maybe stupid question)

9. maybe a silly question, but how to overload String::Format

10. Help (maybe vc++6.0 standard edition bug?)

11. Maybe a stupid question:-( IHTMLDocument---How to reference?

12. Maybe OT: graphics in C (Unix)

 

 
Powered by phpBB® Forum Software