Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Static Objects
Static Objects [message #72416] Thu, 31 January 2008 08:01 Go to next message
Eclipse UserFriend
Originally posted by: benjamin.wolff.web.de

Hi!

until now, i wasn't aware that static objects belong to every session (pls
don't laugh :) ). thats a big problem because i need to use static objects
for a db connection for example. a single view has a static variable
because other views need to change/read this value and i can't deliver the
view object to every other objects to call the getter and setter.
so i need a way to put global objects (such as non-static db connection,
integers and strings) in my app so every other object can get acces to
it (PlatformUI... maybe??). until now i didn't find a way to do so
(IWorkbenchConfigurer provides getData() and setData() but i don't know
how to get access to from any class inside my application).
is there a way to set such global objects? another chance may be with
sessionsingleton, but thats not practicable since i just need global
objects that belongs to only one session.

help pls, this issue just screwed up my whole application because i didn't
know and realised it ://.

thx!
Re: Static Objects [message #72437 is a reply to message #72416] Thu, 31 January 2008 08:45 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ben,
I am not quite sure but isn't SessionSingletonBase about having one object
that belongs to only one session?
So that would suit your requirements.
In our project we've made good experience with SessionSingletonBase to hold
user relevant data and also a reference to the db server.
You can access it from allover of our project.
Regards

Oliver

Ben W. schrieb:
> Hi!
>
> until now, i wasn't aware that static objects belong to every session
> (pls don't laugh :) ). thats a big problem because i need to use static
> objects for a db connection for example. a single view has a static
> variable because other views need to change/read this value and i can't
> deliver the view object to every other objects to call the getter and
> setter. so i need a way to put global objects (such as non-static db
> connection, integers and strings) in my app so every other object can
> get acces to it (PlatformUI... maybe??). until now i didn't find a way
> to do so (IWorkbenchConfigurer provides getData() and setData() but i
> don't know how to get access to from any class inside my application).
> is there a way to set such global objects? another chance may be with
> sessionsingleton, but thats not practicable since i just need global
> objects that belongs to only one session.
>
> help pls, this issue just screwed up my whole application because i
> didn't know and realised it ://.
>
> thx!
>
Re: Static Objects [message #72454 is a reply to message #72437] Thu, 31 January 2008 08:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: benjamin.wolff.web.de

hm yes, but most time i only need a static method or a static value, but
looks like theres no other way. i could do it quick and dirty, i create
one class that holds all my static methods and attributes. maybe not
pretty but it's very important that this thing runs in near future =)
Re: Static Objects [message #72472 is a reply to message #72437] Thu, 31 January 2008 08:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: benjamin.wolff.web.de

i just that there has to be an object in the application that belongs to
only one user session (Workbench or something), and maybe that it is
possible to provide some objects to this objects...
Re: Static Objects [message #72490 is a reply to message #72472] Thu, 31 January 2008 09:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: abo.splitshade.de

Well, Workbench etc.. is also realized via a SessionSingleton, I donŽt see
why SessionSingletons would not match your requirements, the
Implementation is exactly what you are looking for..
Re: Static Objects [message #72507 is a reply to message #72490] Thu, 31 January 2008 09:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: benjamin.wolff.web.de

ok, i see, thanks for your help!!

but what i don't understand, i use external jars such as ojdbc for
database connection or itext, they use static objects internally. how can
one be sure that this won't be a problem in multi-user mode?
Re: Static Objects [message #72714 is a reply to message #72507] Fri, 01 February 2008 08:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fappel.innoopract.com

Hi,

that's an important point. Any third party library you are using must be
usable in session aware context. Class variables (to use the correct
term) are not bad in all cases. A connection-pool for example is shared
over session boundaries and may be implemented using class variables and
synchronization.

Ciao
Frank


-----Ursprüngliche Nachricht-----
Von: Ben W. [mailto:benjamin.wolff@web.de]
Bereitgestellt: Donnerstag, 31. Januar 2008 15:26
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: Static Objects
Betreff: Re: Static Objects


ok, i see, thanks for your help!!

but what i don't understand, i use external jars such as ojdbc for
database connection or itext, they use static objects internally. how
can one be sure that this won't be a problem in multi-user mode?
Re: Static Objects [message #72733 is a reply to message #72507] Fri, 01 February 2008 08:52 Go to previous messageGo to next message
Eclipse UserFriend
Ben W. schrieb:
> ok, i see, thanks for your help!!
>
> but what i don't understand, i use external jars such as ojdbc for
> database connection or itext, they use static objects internally. how
> can one be sure that this won't be a problem in multi-user mode?
>

Well the JARs you referenced are used in so many J2EE projects if there
would be a problem this would have been fixed ages ago :-)

The real problem as you noticed are UI-Libs (e.g. the whole RCP stuff)
which are normally not designed for multi-user setups.

Tom

--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Static Objects [message #73091 is a reply to message #72490] Wed, 06 February 2008 21:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: m.n.com

Martin wrote:
> Well, Workbench etc.. is also realized via a SessionSingleton, I donŽt
> see why SessionSingletons would not match your requirements, the
> Implementation is exactly what you are looking for..
>
What if you want to use the same code for RCP as you do for RAP?
Re: Static Objects [message #73107 is a reply to message #73091] Thu, 07 February 2008 03:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi again,

this is an issue that I coped with some time ago.
You cannot use the SessionSingleton - Implementation in Rich Client
Applications,
but you can use an Interface as abstraction and refactor the underlying
implementation in platform-specific plugins. This works perfectly well and
is easily done.

Greetz

Martin
Re: Static Objects [message #73160 is a reply to message #73107] Thu, 07 February 2008 19:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: m.n.com

After posting I googled while i waited for a response and found the
solution you referred to.

Martin wrote:
> Hi again,
>
> this is an issue that I coped with some time ago.
> You cannot use the SessionSingleton - Implementation in Rich Client
> Applications,
> but you can use an Interface as abstraction and refactor the underlying
> implementation in platform-specific plugins. This works perfectly well
> and is easily done.
>
> Greetz
>
> Martin
>
Re: Static Objects [message #73231 is a reply to message #73160] Fri, 08 February 2008 08:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: abo.splitshade.de

Hi,

where did you find this? I worked this out for myself, is there any
documentation about this somewhere? I did quite a huge amount of research
for using the synergies between rap and rcp, and i would like to read, if
my research brought the correct and efficient results:)
Re: Static Objects [message #73338 is a reply to message #73231] Fri, 08 February 2008 23:36 Go to previous message
Eclipse UserFriend
Originally posted by: m.n.com

Hmmm. Not exactly sure. But there is this -
http://www.ibm.com/developerworks/opensource/library/os-ecli pse-richajax2/

and I looked at Test code downloaded with the RAP demo. It looks like
what you did.

Martin wrote:
> Hi,
>
> where did you find this? I worked this out for myself, is there any
> documentation about this somewhere? I did quite a huge amount of
> research for using the synergies between rap and rcp, and i would like
> to read, if my research brought the correct and efficient results:)
>
Previous Topic:Deployment on Oracle application server
Next Topic:Rap and Hibernate
Goto Forum:
  


Current Time: Sat Aug 30 18:55:58 EDT 2025

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

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

Back to the top