本文源于公司内部技术交流,如有不当之处,还请指正。

Content:

1. What is Data-driven design?
2. WPF revolution.
3. More about ObservableCollection.
4. Question.
 
1. What is Data-driven design?
Data-driven design: is a design of using entity or module to control the software how to display and design. Now in Wikipedia, the article had been redirected to Responsibility-driven design which is inspired by the Client/Service Mode. The Client/Service model they refer to assumes that a software client and a software server exchange information based on a contract that both parties commit to adhere to. The client may only make the requests specified, the server must answer them.
简而言之,广义上来说数据驱动设计是以数据为中心展开的设计方式,与以往的由界面至数据结构的方式相反,首先要从数据结构/数据模型下手,完善数据控制层/业务逻辑层,最后在到界面的设计。
 
 
Summary: 
1 It’s just a different way that how to design software. It’s a design method not writing code directly. 只是一种不同的设计软件的思想,方式。
2 As usual, we design software from interface to data source, firstly drag user control to panel and secondly write control event. It’s also called up to down design. 通常,我们是从上之下的设计方式,先界面,后模型。
3 On the opposite side, we use down to up design. From data module to user interface, we design around data module that compared with usual design, it’s called Inversion Of Control. 相反,我们是从数据入手展开软件设计,一切以数据为中心;底层数据驱动开发,界面依赖于数据,也叫做控制反转。
 
Application:
1 WCF
  First,we make a data module. Like this:
  
  Second, we make a WCF service in order to provider functions around data module.
  
 
 
2 WPF Revolution.
 Winform DataBinding:
   如果在Winform下开发,实现数据的双向绑定,当然是依靠委托的方式实现的。底层数据模型提供一个广播委托Speaker,当数据发生改变时,触发委托通知。一般来讲我们需要构建一个通道用于共享并集中管理通道消息Channel,通道将收集上来的消息发送给监听者Listener。
  
  WPF DataBinding:
  WPF 提供了ObservableCollection 实现数据集合的双向绑定,INotifyCollection是对Module层的数据更新通知,底层实现的代码与上面的实现方式几乎相同,而ObservableCollection则是对List进行了二次封装,提供List.Add,List.Remove级别上的绑定,就是说如果数据集合发生变化,也将会通知相关Listener。
  本质上来说,WPF 的ObservableCollection 和 INotifyCollection并未提供什么新鲜的东西,只是一次便捷的封装。当然这里也要公平的说一下,这2个类只是WPF DataBinding思想的一部分而已,另外还包括界面的动态绑定,属性的双向绑定等等,都是一次思想上的革新!
 
 
Summary
–1. DataBinding’s essence is a method of using delegate which need both listener and speaker.
–2. WPF build-in support XAML Binding grammar.
–3. DataBinding is not just used for implement INotifyCollectionChanged interface, also you can only use the class Binding for yourself binding application.
–4. If you need a list of data support two-way binding, you should use ObservableCollection instead of Ilist.
–5. Data-Binding is just a method of software design not just only in WPF.
 
 
 

OpenDiscussion_DataDrivenDesign的更多相关文章

随机推荐

  1. 慕课网access_token的获取

    access_token的接口是微信公众号一个基础接口,access_token接口微信公众号一个非常重要的接口 access_token是微信公众号的全局唯一票据,公众号的所有接口的调用都需要使用到 ...

  2. ECMAScript5新特性之isFrozen、freeze

    对象被冻结后: 1 不能添加属性. 2 不能删除属性. 3 不能修改属性.(赋值) 4 不能修改属性描述符.(会抛异常) var fruit = { name : '苹果', desc : '红富士' ...

  3. TZOJ 5280 搜索引擎(模拟字符串)

    描述 谷歌.百度等搜索引擎已经成为了互连网中不可或缺的一部分.在本题中,你的任务也是设计一个搜索论文的搜索引擎,当然,本题的要求比起实际的需求要少了许多. 本题的输入将首先给出一系列的论文,对于每篇论 ...

  4. ios 工具大全,最全框架

    https://www.jianshu.com/p/e280f3348156 [链接]文件分享 - 网盘分享https://share.weiyun.com/5A1aura

  5. maven仓库的作用以及仓库的分类

    maven的工作需要从仓库下载一些jar包,如下图所示,本地的项目A.项目B等都会通过maven软件从远程仓库(可以理解为互联网上的仓库)下载jar包并存在本地仓库,本地仓库 就是本地文件夹,当第二次 ...

  6. Spring整合Struts2框架的第二种方式(Action由Spring框架来创建)(推荐大家来使用的)

    1. spring整合struts的基本操作见我的博文:https://www.cnblogs.com/wyhluckdog/p/10140588.html,这里面将spring与struts2框架整 ...

  7. 欲哭无泪的p-value = 0.051 | 做几次重复能得到较低的p-value

    欲哭无泪的p-value = 0.051 | 做几次重复能得到较低的p-value 已有 1469 次阅读 2017-12-15 14:12 |个人分类:RNA-seq|系统分类:科普集锦|关键词:R ...

  8. 21个ui设计技巧,让你的设计不落伍

    1.功能性极简主义 不少移动端APP和网站开始基于极简主义设计风来设计,而极简主义本身并非关注所有的信息,而是通过减少非关键信息来突出特定的内容,它是有着极强的功能性和偏向的.它有着如下的特征: ・简 ...

  9. [BAT] xcopy拷贝远程服务器共享文件到本地

    net use * /del /yes NET USE Y: \\10.86.17.243\d$ Autotest123 /user:MSDOMAIN1\doautotester set source ...

  10. Java数据结构和算法(三)顺序存储的树结构

    Java数据结构和算法(三)顺序存储的树结构 二叉树也可以用数组存储,可以和完全二叉树的节点一一对应. 一.树的遍历 // 二叉树保存在数组中 int[] data; public void preO ...