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: 241
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
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: 166
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: 241
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
Previous Topic:deployed war reports 404 but works in IDE
Next Topic:Custom widgets example source code
Goto Forum:

Current Time: Thu Apr 27 11:22:35 GMT 2017

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

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