Thanks for your replies!
If you give us some more details about what you are trying to achieve, someone might be able to give you a firmer answer.
OK I have a "Character" class on the server and client that represents the players' characters. It has some attributes (name, skills, experience points, position) which values are changed on the server when the clients sends valid actions. The updates should be replicated to the clients (also to clients that don't "own" a character, if they have a character that "sees" the other)
Can you give a code example on how you would declare the classes in your solution endolf?
tigeba, I understand your solution for replication, except I don't know how the client and server classes' common interface fits in.
If I use a interface, what about the common attributes of the SimObject? Wouldn't it be better to have a base class which stores that data?
1 2 3 4
| SimObject extends SimObjectBase implements ManagedObject, SimEventListener { .. } |
Or maybe that's what you (endolf) mean with using a reference to a real object:
1 2 3 4 5
| SimObject implements ManagedObject, SimEventListener { SimObjectBase data; .. } |