The design of a distributed variant of Plato framework to support collaborated editing
A first thought system architecture (pulling mode) is one that the server doesn't keep client information and the client takes a more active part in retrieving updates from the server,
Note the previous model manager which is responsible for both the management of the entire model collection and the model provisioning for the rendering department is now split to two parts each taking one of the responsibilities respectively and communicating with each other locally or on the wire.
Server | Client
o IModelProvider
|
ModelManager ---------- Local/Remote ---------> On-screen model provider ---> View/View Model department
[All models] 1. -> 'model changed' signal [On-screen models]
<- check current o/s async
-> reply if its update
<- current collection
-> changes in collection
2. <- sight change
<- current collection
-> changes in collection
(any new signal invalidates updated)
<----------------------------------- Handlers
references local o/s first
1. <- send update
2. -> Acknowledge update
For recording, for each client request a recording object is instantiated and starts listening on user's further request and working as normal on the revision tree on the server as usual.
For playback, The recording is sent to the client who will also have a copy of the tree (which should only add up and not change or reduce) to play the recording on.
For undo and redo, it's also totally up to the server, and the client is subject to its latest update.
Obviously the communication between the client and server for updating the models is not complete yet and there are lots of cases that need to be dealt with. So this pattern has a high complexity in the client design which is error prone, inflexible to changes, and against the general app design guidelines.
Last night before I fell a sleep I came up with an idea of using sort of pushing mode, which should be so straightforward and had been so long missing from my mind. In detail, it's using a more sophisticated server and the principle of matching design and minimal data exchange.
Take a look at the architecture first,
Server | Client
o IModelProvider
|
ModelManager --> Per-session On-screen --------Local/Remote -------> On-screen provider ---> View/View Model
[All models] [On-screen models]
Client view scope info Handshakes,
<- client view changes
-> update of on-screen list
and individual model data
EXCLUDES unnecessary self
initiated model changes
Handlers
references local o/s first
<-----------------------------
model changes
This design greatly simplifies the data exchange and therefore makes it much more manageable by minimising the model data update to only changes to on-screen list and models. It's literally a split of on-screen model provider with each part sitting on either server or client with a minimum communication between. Consequently, the cost is the provider on the server needs to keep a session for each client which consists of a mirror of the clients on-screen list and the client's current view scope, which is totally reasonable and affordable.
The handlers check the local on-screen list as well (again it makes sense, as only those on-screen can be manipulated) and immediately report the changes to the server and leave the server to confirm and make the verfied model update. (Here mechanism for proper presentation/notification is needed if the update is rejected/invalidated)
Another question that remains is how to determine if a model is on screen if its representing shape and size is not certain before rendered.
One simple solution to it is completely get the server to decide the on-screen status using approximation in a C/S scenario, which is fine in most uses.
However if a finer approach is really needed, it can be
- canvas simulation on the server (which is subject to the system support on the server)
- use a distributed version of posterior checking mechanism, which is to flag all changed size undetermined model as VisualToMeasure initially and get client to update their dimension information. In a distributed scenario, the server may receive multiple client responses, however in this application, the measurements are supposed to be close to each other, the server just needs to average them out.
The design of a distributed variant of Plato framework to support collaborated editing的更多相关文章
- Posterior visual bounds retrieval for the Plato framework
Plato is a MVVM compliant 2D on-canvas graphics framework I've been designing and implementing for d ...
- Domain Driven Design and Development In Practice--转载
原文地址:http://www.infoq.com/articles/ddd-in-practice Background Domain Driven Design (DDD) is about ma ...
- HDFS分布式文件系统(The Hadoop Distributed File System)
The Hadoop Distributed File System (HDFS) is designed to store very large data sets reliably, and to ...
- Distributed transactions in Spring, with and without XA
While it's common to use the Java Transaction API and the XA protocol for distributed transactions i ...
- 创建Material Design风格的Android应用--应用主题
本人全部文章首先公布于个人博客,欢迎关注,地址:http://blog.isming.me 昨天正式公布了android 5,同一时候android developer站点也更新了,添加了创建Mate ...
- Distributed MVCC based cross-row transaction
The algorithm for supporting distributed MVCC based cross-row transactions on top of a distributed k ...
- Android Material Design 兼容库的使用
Android Material Design 兼容库的使用 mecury 前言:近来学习了Android Material Design 兼容库,为了把这个弄懂,才有了这篇博客,这里先推荐两篇博客: ...
- Android应用Design Support Library完全使用实例
阅读目录 2-1 综述 2-2 TextInputLayout控件 2-3 FloatingActionButton控件 2-4 Snackbar控件 2-5 TabLayout控件 2-6 Navi ...
- Android Design Support Library: 学习CoordinatorLayout
简述 CoordinatorLayout字面意思是"协调器布局",它是Design Support Library中提供的一个超级帧布局,帮助我们实现Material Design ...
随机推荐
- Lattice 的 DDR IP核使用调试笔记之DDR 的 仿真
—— 远航路上ing 整理于 博客园.转载请标明出处. 在上节建立完工程之后,要想明确DDR IP的使用细节,最好是做仿真.然后参考仿真来控制IP 核. 仿真的建立: 1.在IP核内的以下路径找到以下 ...
- Android4.4 以太网和DHCP启动过程介绍
转自:http://blog.csdn.net/wlwl0071986/article/details/51451843 Android4.4已经加入了以太网的支持.现在对以太网的初始化流程.网络策略 ...
- .NET yield
.Net Yield 其实比较简单,手动yield,一学就会. public static class GalaxyClass { public static void ShowGalaxies() ...
- 数据结构之图 Part3 – 1 遍历
DFS using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ...
- RTCP资料详解
转自:http://www.360doc.com/content/13/0606/10/1317564_290865866.shtml RTCP RTCP协议将控制包周期发送给所有连接者,应用与数据包 ...
- 如何学习FPGA?FPGA学习必备的基础知识
如何学习FPGA?FPGA学习必备的基础知识 时间:2013-08-12 来源:eepw 作者: 关键字:FPGA 基础知识 FPGA已成为现今的技术热点之一,无论学生还是工程师都希望 ...
- poj 3264 【线段树】
此题为入门级线段树 题意:给定Q(1<=Q<=200000)个数A1A2…AQ,多次求任一区间Ai-Aj中最大数和最小数的差 #include<algorithm> #incl ...
- C[泊车管理系统]
// // main.c // 泊车管理系统 // // Created by 丁小未 on 13-7-14. // Copyright (c) 2013年 dingxiaowei. All ...
- hdu 4597 + uva 10891(一类区间dp)
题目链接:http://vjudge.net/problem/viewProblem.action?id=19461 思路:一类经典的博弈类区间dp,我们令dp[l][r]表示玩家A从区间[l, r] ...
- Practical JAVA(二)关于对象的类型和equals函数
Practice5,6,9,10,11,12,13,14,15 ==判断等号两边两个变量储存的值是否相同,如果是两个对象,则判断两个变量储存的对象地址是否相同. 大多数时候,我们需要判断的不是左右两个 ...