|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Singleton implementation over multiple instances of one DLL (copy) ?I have a class (called pluginmanager) that gets loaded indirectly by an assembly loaded with a call to LoadFrom. On the other hand I use operator new on other plugins, that are directly known in my test project. So i mix the way of creation of objects. How do I avoid using a new instance from a 'local' DLL when the plugin DLL is already loaded ? (The local DLL may reside in the test application that uses this mixture) The plugin DLL is at a known place. Are there any solutions ? Thanks, Lothar cant u use the singleton pattern .... private constructor ... public
GetInstance method ..... etc ...... Show quote "Lothar Behrens" <lothar.behr***@lollisoft.de> wrote in message news:1171973419.837316.72340@j27g2000cwj.googlegroups.com... > Hi, > > I have a class (called pluginmanager) that gets loaded indirectly by > an assembly loaded with a call to LoadFrom. > On the other hand I use operator new on other plugins, that are > directly known in my test project. > > So i mix the way of creation of objects. > > How do I avoid using a new instance from a 'local' DLL when the plugin > DLL is already loaded ? > (The local DLL may reside in the test application that uses this > mixture) > > The plugin DLL is at a known place. > > Are there any solutions ? > > Thanks, Lothar > Mubashir Khan schrieb:
> cant u use the singleton pattern .... private constructor ... public This didn't solve my main problem.> GetInstance method ..... etc ...... Dim o as MyClass = MyClass.GetInstance() usually creates an instance form the same physical DLL. But there is already an instance from a copy of the DLL. I want to reuse the yet loaded version. Any ideas ? Lothar Show quote > "Lothar Behrens" <lothar.behr***@lollisoft.de> wrote in message > news:1171973419.837316.72340@j27g2000cwj.googlegroups.com... > > Hi, > > > > I have a class (called pluginmanager) that gets loaded indirectly by > > an assembly loaded with a call to LoadFrom. > > On the other hand I use operator new on other plugins, that are > > directly known in my test project. > > > > So i mix the way of creation of objects. > > > > How do I avoid using a new instance from a 'local' DLL when the plugin > > DLL is already loaded ? > > (The local DLL may reside in the test application that uses this > > mixture) > > > > The plugin DLL is at a known place. > > > > Are there any solutions ? > > > > Thanks, Lothar > > |
|||||||||||||||||||||||