Understanding singletons?

  • Thread starter Thread starter Binary Poet
  • Start date Start date
B

Binary Poet

I have a project that is a DLL which is nothing more than a VB Module with a
number of public classes inside of it. From what I have read, it is possible
to have this DLL be only started once.
For example, I have to different applications that use this DLL described.
What I need is for both these applications to use the same instance of the
DLL (or I can make it an EXE if need be) so I can share properties back and
forth between the applications (ie: IsAuthenticated, etc...)

Any idea's or pointers on this?

Thanks!.
 
Jan. 10, 2005

Singleton objects are used in .Net Remoting. Singleton objects are
created once and all incoming calls to that executable are executed with one
instance. SingleCall objects create a new object everytime a method is called
(which isn't what you need). If it is set up for .Net Remoting then SingleTon
is exactly what you need. I hope this helps and have a great day!


Joseph MCAD
 
That actually does help me understand this alot better...

Since this is all going to be on the same machines (applications and the
"dll") can I still use remoting?

Many Thanks,

Steve
 
Jan. 10, 2005

.Net Remoting is used for communicating across networks, machines, and
application domains. You would fall under the category application domains.
The dll and each application that is using the dll is under its own app
domain and therefore cannot communicate under normal circumstances. .Net
Remoting is used to bridge these gaps and allows your applications to
communicate and get results from the dll. So the answer to your question is
yes. :) It is always nice to know that the solution is simple! If this reply
or the last helped you, then please click on the "Yes" button just above or
below this message where the question asks "Was this post helpful to you?".
Thank you and have a great day!! Ask more if needed! :)


Joseph MCAD
 
Sorry to say, I am using Outlook Express for the news groups. (so I will not
be able to click)

But to anyone watching (reading) Joseph was of great help with this!!!!!!


Steve
 
Hello!

You actually also answered my outstanding question about how to share an
object between two running programs. The problem is the application domain,
each shared variable lives in. Therefore we cannot simply use a shared
varibale as a message holder. Unfotunately we must use remoting in this case.

Regards,
Joachim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top