Singleton EditPart [message #209156] |
Sun, 12 February 2006 08:35 |
Eclipse User |
|
|
|
Originally posted by: evaldas.taroza.stud-inf.unibz.it
Hi,
I want to implement Singleton design patern for one of my edit parts. So
I make a private final static reference to the edit part, private
constructor and public static getInstance(). The edit part factory calls
getInstance().
The problem is that even when I close the editor and open it again I get
the same singleton instance, although I would expect that every time I
open it, GEF creates a new singleton for me. In other words I want a new
singleton instance in every editing session, and every graphical editor.
What am I doing wrong?
Thanks.
Zeppe
|
|
|
Re: Singleton EditPart [message #209218 is a reply to message #209156] |
Mon, 13 February 2006 09:41 |
Eclipse User |
|
|
|
Originally posted by: ingo.koch[nospam].sap.com
Well, as the name says, a singleton is a singleton (the same static
instance) as long as you do not restart the JRE.
Regards, Ingo
"Zeppe" <evaldas.taroza@stud-inf.unibz.it> wrote in message
news:dsms1b$roc$1@utils.eclipse.org...
> Hi,
> I want to implement Singleton design patern for one of my edit parts. So
> I make a private final static reference to the edit part, private
> constructor and public static getInstance(). The edit part factory calls
> getInstance().
>
> The problem is that even when I close the editor and open it again I get
> the same singleton instance, although I would expect that every time I
> open it, GEF creates a new singleton for me. In other words I want a new
> singleton instance in every editing session, and every graphical editor.
>
> What am I doing wrong?
>
> Thanks.
> Zeppe
|
|
|
Powered by
FUDForum. Page generated in 0.02668 seconds