I have been thinking a long time on how to conciliate those 2 requirements for a board game server that notify players in real-time:
First requirement tells me "make an mutable observable object". Second requirement tells me "make an immutable object" to expose state safely.
Which model would you choose to implement the rules? Mutable or Immutable?
Replaying games, connotating single steps, computer algorithms (undo, tries), would favor immutable objects.
That then you want to send the current snapshot to a newly entering user, is a secundary issue: keep a current snapshot, entire picture around.
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.