简体   繁体   中英

Java client/server architecture

I have some experience using JAVA EE 6 along with frameworks like Seam, I've used glassfish and Jboss AS. I want to develop a couple of games now and they have a client/server architecture, but using an application server seems like an overkill as each party must set up their server to play, so I thought about going with plain Java SE. I've read about grizzly and nio.

My problem is, I've only found examples on how to implement this in a very simple case. Or they seemed unnecessarily complex. I was thinking about using MVC with observer so I have a clean separation between the game logic and the views, along with remote proxies to simulate that the other players are playing locally, so I don't need to duplicate logic if I ever want to add AI players.

Can you point me in the right direction? Is that a good idea? Resources on this? I understand the are a lot but I'm looking for best practices or a fancy approach on solving this.

IMHO, The simplest way to distribute game data is to use JMS Topics. This will ensure the same messages are distributed across your system. (And it will take care of the sockets)

I would use ActiveQ because its easy to get started, however HornetQ is a very fast free server.

This will allow you to distribute your application how you like.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM