• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB and games

 
Shawn Garner
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it just me or is all of the J2EE Beans NOT suitable for multiplayer game server? I have an applet that needs to get updates from the server. I wanted to do a Session bean but it seems to be designed on ly for one client. I don't want to break my pocketbook by having to host my own game server on my own machine.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35744
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Stateful Session Bean is suited for one client and certainly wouldn't meet your needs. A Stateless Session Bean can service multiple clients. It does a bit of work and returns to the pool.
 
Shawn Garner
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then how would the game state remain on the server if the session bean is stateless. Persisted to a database or file? This game doesn't maintain that much data. It's just a card game although I would like to make it scalable to support more games.

Shawn
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35744
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shawn,
The applet could hold some of the state.
 
Shawn Garner
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But then you run into trying to synchronized multiple client states.
Also the client will be bigger because it will have house all the other clients data in case one client leaves and you want to add another in it's place.
Sounds messy to me.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!