I am conceiving client/server architecture for application that has pretty old-school server-side code I cannot modify myself; It can only send data to client as response to direct client's query - think of it like old school AJAX (through it is not browser based). The server specifically cannot push information to any client without query.
The problem is my client allows multi-login and as such some data may be changed elsewhere, while the client is unaware (until next query). I also accept client-to-client collaboration (with server serving only as helper and optional NAT hole puncher)
Now for the actual questions: which design/code patterns would be useful in such scenario, where the app should be scallable and maintainable? I already googled Command/Query separation pattern, but subscribing to events would be silly, as no event can come without query (which would induce constant checking for events...)
One more thing - the server code does not support transactions, only sort of check (read returns version code which subsequent write may post back. If the version noted by write op differs from read it means the data was changed in between and error code is returned)
Aucun commentaire:
Enregistrer un commentaire