Now is the time to go back to the drawing board, write down the existing design and even change it. One such issue is the overall design of the client/server framework. Looking at what is there and what is regarded as modern design I came up with this proposal.
Schematic of the proposed Client/Server design in FreeRails |
The server checks the proposed change for applicability and either accepts it or rejects it. It then applies the change to itself and sends it to all clients so they can apply it to their copy of the model and the user will see them. It follows that this way all the client models will be in sync with the server model, although they may lag behind. To make sure they don't miss anything, the broadcasted, accepted changes will be enumerated or similar.
One can see nicely, how the information flows in a circle, from the view (user input) through presenter, local client model, server model, local client model again, presenter again and finally a change is displayed.
I think this requires the lowest amount of coding effort while still delivering robust performance and good separation of concern and modularity.
P.S. For drawing the design diagrams I use draw.io which is an excellent tool and works for me like a charm.
No comments:
Post a Comment