Hi We have to create a game as JApplet. This Applet should load the levels/tasks from the project-page level by level, not instantly when the game starts. The Applet should also load Hiscores while loading the game and save them after finishing the game into a database. The main problem is, that we dont exactly know which technology to use. We don`t have much experience in databases and connection-based programming, therefore it need`nt be fast. The maximum number of players is estimated about 100 at time. Could you give me the best option for this problem? We discussed implementing a SQL-DB, which would fit our interests(and retrieving the stats) best. Or does a better version exist? With regards Robert
My option is: a. build a database component on the server side which connects to DB using JDBC b. build EJBs that implement business logic via that database component c. rewrite your applet to utilize the EJBs
EJB are overkill in almost all cases, this being one of them. I think a fullblown database may be overkill here as well. Store the levels as flat files which are cached in memory by the serverside process for performance. Highscores can be stored in either an embedded database or also in a flat file (again, memory caching may be called for). Create a simple server process communicating with your applet using a TCP/IP socket. Make it multithreaded (thus you need to make your caching and/or data access code threadsafe).
You can 1. have Applet to Servlet communication 2. servlet talks to the database or Have signed applet which directly talks to remote database. (Risky business)
Joined: Jun 05, 2002
Thanks so far for your suggestions. @wally Is the whole servlet-story difficult to implement? We only have 2-3 weeks time for that, without any experience in database-design ans so on. It is also very hard to find sourcecode for this adventure, does anybody have some examples?