Re: using a factory to control instances
- From: Michael Meeks <michael ximian com>
- To: Jacob Perkins <jap1 users sourceforge net>
- Cc: bonobo <gnome-components-list gnome org>
- Subject: Re: using a factory to control instances
- Date: 24 Apr 2003 09:04:35 +0100
Hi Jacob,
On Thu, 2003-04-24 at 05:12, Jacob Perkins wrote:
> I want to use a bonobo factory for creating controls (or any
> BonoboObject). I already have a setup working that was basically copied
> from the sample control in libbonoboui. However, I only want one
> instance of this control. So, given 'moniker', I want to create a new
> BonoboObject if it doesn't exist yet, or return the already created one.
> However, if given 'moniker:new', I want to create a new instance of the
> object. Since there are no guarentees as to which process will request
> the first instance, how do I do this. To make it simple, how would one
> modify the sample control to support this?
> I know this can be done with a static variable or object, but it seems
> that factories should provide a better way to do this.
So - your factory is likely to be a singleton across processes (
assuming it is an executable and not a shared object ); So I guess you
can aggregate things to the factory (the singleton), and the result of
:new will be what comes out of the factory ;-)
All method invocations on those objects will be processed in the same
process though - so, it's fairly easy to get it to work.
What are you trying to achieve though ?
Regards,
Michael.
--
mmeeks gnu org <><, Pseudo Engineer, itinerant idiot
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]