Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  persistant preferences with web start  (Read 3196 times)
0 Members and 1 Guest are viewing this topic.
Offline markuskidd

Junior Member


Medals: 1



« Posted 2002-12-22 01:38:48 »

I am considering switching to web start for deploying my application so that I can take advantage of it's built-in auto-updating features, but I am trying to locate information on the preferred method of storing stuff like the player's preferences, or perhaps chat logs, etc. Should I just ask for permission to create a folder on their drive and store it there?
Offline leknor

Junior Member




ROCK!!!


« Reply #1 - Posted 2002-12-22 04:52:21 »

Have you tried the stuff in the java.util.prefs package yet? From the java.util. prefs package description:
Quote
This package allows applications to store and retrieve user and system preference and configuration data. This data is stored persistently in an implementation-dependent backing store. There are two separate trees of preference nodes, one for user preferences and one for system preferences.
I don't know if it will work, I haven't used JWS yet.
Offline markuskidd

Junior Member


Medals: 1



« Reply #2 - Posted 2002-12-22 05:28:11 »

I looked at it, and I think that most or all of the classes are abstract, and are meant to be frontends for database-driven storage that you or (if there are libraries out there for this) someone else implement. The same question about where to stick the files would still apply. Is there a 'standard' or canonical place that JWS coders put this kind of thing? I feel like just creating a directory in the root of my user's hard drive space is a bit unfriendly and presumptious  Grin
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline leknor

Junior Member




ROCK!!!


« Reply #3 - Posted 2002-12-22 05:50:01 »

The classes are astract because they encourage custom implementations but that doesn't matter, each JVM comes with a default implementation and you can access it with the static method at: java.util.prefs.Preferences.userRoot() . Now the question is how does this behave in the context of JWS?
Offline markuskidd

Junior Member


Medals: 1



« Reply #4 - Posted 2002-12-22 06:26:24 »

Missed that on my glance-through, but the docs still raise more questions than they answer. Even outside of JWS, I wonder where/how this information is stored:

Quote

Typical implementations include flat files, OS-specific registries, directory servers and SQL databases.


Hrmm......
I need to google for some more info in the morning..
Offline leknor

Junior Member




ROCK!!!


« Reply #5 - Posted 2002-12-22 23:54:54 »

And the next sentence after the one you quote is:
Quote
The user of this class needn't be concerned with details of the backing store.


Anyway, just do something and abstract your code in such a way that you can change how preferences are manages easily and can do it some other way if you get complaints.
Offline markuskidd

Junior Member


Medals: 1



« Reply #6 - Posted 2002-12-23 06:26:34 »

I'd rather not use it if I knew it was going to dump data in the system registry, for eample. And it would be good to know where a flatfile database would be created. Could this class hijack an SQL server that is running on a user if it allows anonymous access? Every option mentioned potentially has serious drawbacks Cheesy

By this time, I could have written a test program. What a loser I am  Cool
Offline Herko_ter_Horst

Senior Newbie




Java games rock!


« Reply #7 - Posted 2002-12-24 11:59:41 »

The default implementation on Windows will indeed use the registry to store preferences. I think on Linux a file-based solution is used. It should be possible (at the expense of more code to download, of course) to roll your own always-file-based solution.

I like the prefs package, it's easy to use as-is and does what I want most of the time.
Offline JohnMunsch

Junior Newbie




Founder of GameDev.net


« Reply #8 - Posted 2003-01-02 16:28:52 »

I think the answer to the question of "what does it do under Web Start" is that it depends upon what permissions your WS app has asked for.

If you've asked for full permissions and you've specified that your WS app needs 1.4 to run then you should be able to use any 1.4 API you desire. On the other hand, if you are not asking for permissions in your JNLP file then you are very restricted in what you can call. So you will probably have to use the WS mechanism for persistent storage. It is called muffins and is similar to the cookies mechanism that servers are allowed to use with browsers when they communicate via HTTP.

Personally, I'd rather use the 1.4 preferences stuff.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (13 views)
2014-07-30 21:08:39

Riven (21 views)
2014-07-29 18:09:19

Riven (14 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (32 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (42 views)
2014-07-23 21:16:32

Riven (29 views)
2014-07-23 21:07:15

Riven (30 views)
2014-07-23 20:56:16
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!