Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » SettingStore vs java.util.preferences(Pros and Cons - SettingStore or java.util.preferences?)
SettingStore vs java.util.preferences [message #1017313] Mon, 11 March 2013 15:01 Go to next message
John Gymer is currently offline John GymerFriend
Messages: 191
Registered: November 2012
Location: UK
Senior Member
I have a need to store persistent (non-sensitive) data within my application, which shares a common source base for SWT, RAP and Tabris at present (with just a few differences between each).

For SWT, it seems that using java.util.preferences is the way to go for this type of persistent data, storing local user settings and display preferences etc. This implementation internally will use Windows Registry, Mac .plist files and Linux properties/java files, which is fine - let the runtime handle it for me based on its platform and I'm happy!

However, when it comes to RAP, is java.util.preferences a good idea? Does it work on all AppServers (I'll be running my RAP/Tabris versions under a variety of appservers on a variety of platforms from Windows rights up to mainframe)?

Is the RWT SettingStore more appropriate, more reliable, or does SettingStore actually use java.util.preferences underneath for its default implementation?

Any useful comments and opinions most appreciated!
Thanks, John


---
Just because you can doesn't mean you should
Re: SettingStore vs java.util.preferences [message #1017414 is a reply to message #1017313] Mon, 11 March 2013 19:33 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 102
Registered: February 2011
Senior Member
If you are going to be maintaining a piece of software that runs on multiple platforms, I think it would be best to make the maintenance of them as much the same as possible.
If you need to move an installation from one server to another, the last thing you want to have to do is migrate the configuration/persistent data. Especially if you're moving from a Windows host to a Linux host because the Windows host won't boot anymore, so the data in the registry is hard to access.

If you want to store data outside the scope of a session, java.util.preferences is a better option. If I was implementing that I'd write my own SPI implementation based on the Linux Preferences, storing data in properties files.
Re: SettingStore vs java.util.preferences [message #1017650] Tue, 12 March 2013 09:09 Go to previous message
John Gymer is currently offline John GymerFriend
Messages: 191
Registered: November 2012
Location: UK
Senior Member
Thanks for your comments Chris.
This is kind of the road I was going down, although initially I will just use the default implementation of java.util.prefs, as I'm not too worried about porting the data - it will only be used for user display preferences, such as window size/position, and other similar options - it isn't business critical data.
I was thinking of using this for SWT (all platforms), but using SettingStore for RAP and Tabris - although one concern I read somewhere was that SettingStore property files on the appserver get wiped whenever the appserver is restarted... is that correct? If so, it isn't much use to me.
Cheers, John


---
Just because you can doesn't mean you should
Previous Topic:TreeViewer : how to set focus on a particular cell
Next Topic:Adding toolbar on Table rows
Goto Forum:
  


Current Time: Tue Nov 25 02:03:17 GMT 2014

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

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