Home All Groups Group Topic Archive Search About

Singleton implementation over multiple instances of one DLL (copy) ?

Author
20 Feb 2007 12:10 PM
Lothar Behrens
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

Author
20 Feb 2007 4:03 PM
Mubashir Khan
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
>
Author
20 Feb 2007 9:27 PM
Lothar Behrens
Mubashir Khan schrieb:

> cant u use the singleton pattern .... private constructor ... public
> GetInstance method ..... etc ......

This didn't solve my main problem.

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
> >

AddThis Social Bookmark Button