This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Serialized object or Remote object ?

 
Jibby Lala
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

hello all,

i m trying to create a framework for creating distributed applications, i wanted to decouple server functionality like registering/join, unregister the clients and application functionality like for the game logic, in two different remote objects. i m also declaring the callback remote object which has the only the update method, which is implemented by the clients to get updated by the server.

i have general concept about serialized objects.

but in this scenario i m not sure whether i need to use serialized object for application logic (which could consist of several objects) or remote object is ok?

God bless

jibby
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, Jibby!

i m trying to create a framework for creating distributed applications, i wanted to decouple server functionality like registering/join, unregister the clients and application functionality like for the game logic, in two different remote objects. i m also declaring the callback remote object which has the only the update method, which is implemented by the clients to get updated by the server.


So, there are going to be 2 remote objects + 1 remote object that will be observable, right?

Well champ, the thing is, the objects that will be transferred over the network will have to implement java.io.Serializable. So, for instance, depending on the way you implement your callback, the Serializable objects will be transferred from the server to the client side or the server will call the clients and they will go to the server and get the updates.
 
Jibby Lala
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well thanks for reply
i have a example design like this:

at client site i have this method which is getting update from/ call from server/my game logic:



and this could be so called my business logic class which is remote or serialized, which is for example just logic of chat applicaiton





and this is mycallback interface



my question is that when

when i will go for more complex business logic and i will need to communicate with more classes in that main business logic ,like taking GAMELOGIC i need to communicate with player class ,move class, score class and board class etc.
The flow of application will always be like this(like this message class will be passed as an argument from server and all the communication of client and other classes will only be possible via this class or there is some direct communication with client and with classes possible?) or it can be change. i m not sure, as i get this sample from tutorial or it can be change.
i am not expert, so i need little bit of feedback concerning this design.

THANKS
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic