Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT design decisions
SWT design decisions [message #449609] Thu, 27 January 2005 09:03 Go to next message
Eclipse UserFriend
Originally posted by: timtester2000.yahoo.de

Hello,

I worked with SWT for a while and I have some questions about "good"
design.
Most SWT apps & samples pass the application shell, display ... as
parameters
to other components (i.e. dialogs). Is there any reason not to have static
access to them. So I found it pretty straight forward to make all kind of
Components singletons which are MenuBars, SystemTray because the are
unique in
the application. Do I something miss? Maybe performance, etc.?

Please share your thoughts or point me to a source of enlightment.

Thanks

Tim
Re: SWT design decisions [message #449655 is a reply to message #449609] Thu, 27 January 2005 15:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

It depends on your design, but as soon as you go the static route you
limit future flexibility. You won't be able to run two different
instances of the application at the same time. You need to decide if
this can or cannot be a consideration to think about. All too often I've
seen statics being used to hold state data because it was too cumbersome
to get the information continually passed around. And then when it was
needed to have two separate states of data at the same time you
couldn't. You had to completely redesign everything.


--
Thanks,
Rich Kulp
Re: SWT design decisions [message #449713 is a reply to message #449609] Fri, 28 January 2005 00:54 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Static access to a display is generally not necessary. Widget.getDisplay()
answers the display for the widget and their is a display field in every
event.

"timtester2000" <timtester2000@yahoo.de> wrote in message
news:ctaaph$qqr$1@www.eclipse.org...
> Hello,
>
> I worked with SWT for a while and I have some questions about "good"
> design.
> Most SWT apps & samples pass the application shell, display ... as
> parameters
> to other components (i.e. dialogs). Is there any reason not to have static
> access to them. So I found it pretty straight forward to make all kind of
> Components singletons which are MenuBars, SystemTray because the are
> unique in
> the application. Do I something miss? Maybe performance, etc.?
>
> Please share your thoughts or point me to a source of enlightment.
>
> Thanks
>
> Tim
>
Previous Topic:Button with multi-line text ...
Next Topic:DnD: Outlook email to SWT table
Goto Forum:
  


Current Time: Tue Nov 12 10:48:29 GMT 2019

Powered by FUDForum. Page generated in 0.02033 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top