|
|
|
Re: Discouraged access of RWTLifeCycle.setSessionDisplay(Display) [message #547355 is a reply to message #547338] |
Fri, 16 July 2010 11:50 |
|
Hi Philipp,
subclassing Display is a misuse of the SWT API. You should definitely
not do that. If you need to attach application data to the Display, you
can use Display#setData. But I'd also feel that the session is the right
place to store it.
Regards, Ralf
Philipp Leusmann wrote:
> Am 16.07.2010 13:01, schrieb Stefan Roeck:
>> Hi Philipp,
>>
>>> 1) I know this way is kind of a hack, but I could not find a
>>> straighter way to achieve my target. Any comments?
>>
>> If you want to store data per session you could use a SessionSingleton.
>> What's your use case?
>
> Views in our application may receive events to notify them of available
> udates.
> The common base class we derive all our views from, shows a dialog to
> notify the user, but as you can imagine, this dialog should only be
> shown once per update.
> So i decided to use a semaphore and I thought the display would be a
> convenient place to store it. Of course I could put it directly into the
> session, but still I think it fits nicely into the Display ;)
>
> You have any other recommendations?
>
> Regards,
> Philipp
|
|
|
Re: Discouraged access of RWTLifeCycle.setSessionDisplay(Display) [message #547356 is a reply to message #547355] |
Fri, 16 July 2010 12:23 |
Philipp Leusmann Messages: 36 Registered: July 2009 |
Member |
|
|
Ok guys, you convinced me. A SessionSingleton is even cooler ;)
Am 16.07.2010 13:50, schrieb Ralf Sternberg:
> Hi Philipp,
>
> subclassing Display is a misuse of the SWT API. You should definitely
> not do that. If you need to attach application data to the Display, you
> can use Display#setData. But I'd also feel that the session is the right
> place to store it.
>
> Regards, Ralf
>
> Philipp Leusmann wrote:
>> Am 16.07.2010 13:01, schrieb Stefan Roeck:
>>> Hi Philipp,
>>>
>>>> 1) I know this way is kind of a hack, but I could not find a
>>>> straighter way to achieve my target. Any comments?
>>>
>>> If you want to store data per session you could use a SessionSingleton.
>>> What's your use case?
>>
>> Views in our application may receive events to notify them of available
>> udates.
>> The common base class we derive all our views from, shows a dialog to
>> notify the user, but as you can imagine, this dialog should only be
>> shown once per update.
>> So i decided to use a semaphore and I thought the display would be a
>> convenient place to store it. Of course I could put it directly into the
>> session, but still I think it fits nicely into the Display ;)
>>
>> You have any other recommendations?
>>
>> Regards,
>> Philipp
|
|
|
Powered by
FUDForum. Page generated in 0.02593 seconds