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

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. PR合并回写

    ) as LGORT ,'SAPRFC' as ERNAM,out_pr.due_datetime,out_pr.so_id,out_pr.so_lineid,out_pr.sobsl from V_ ...

  2. JAVA——遍历

    关于遍历,发现了个坑. 详见如下: package com.fxl.test; import java.util.ArrayList; import java.util.Iterator; impor ...

  3. flush(), clear(), save()的简单解释

    hibernate最新发布包的javadoc里对这三个方法的解释是: clear() :Completely clear the session.清空session,该清空操作只对于要保存的.删除的和 ...

  4. 如何添加ECSHOP广告位置

    如何添加ECSHOP广告位置 我们都知道ecshop系统默认的广告位置非常的少,但是一个电子商务网站岂能离开广告?庆幸的是,ecshop预留了足够强大的组件让我们能够完全有可能实现任意我们想要广告位置 ...

  5. Castle ActiveRecord学习(一)简介

    简介 来源:http://www.cnblogs.com/zxj159/p/4082987.html 一.Active Record(活动记录)模式 Active Record是业务逻辑层中(< ...

  6. MVC,MVP,MVVM区别联系

    本质上都是MVC,MVC在不同技术中的应用衍生出MVP,MVVM MVC:b/s MVP:c/s,尤其winform MVVM:wpf http://www.codeproject.com/Artic ...

  7. iOS.ObjC.Compiler.Directives

    Objective-C Compiler Directives @dynamic "You use the @dynamic keyword to tell the compiler tha ...

  8. [SoapUI] 获取当前时间包括年月日时分秒来作为命名

    import java.text.SimpleDateFormat GregorianCalendar calendar = new GregorianCalendar() def dateForma ...

  9. ANT发送邮件需要的3个JAR包

    ANT发送邮件需要的3个JAR包:activation.jar.mail.jar.commons-email-1.2.jar 将这三个jar包放到 $ANT_HOME/LIB 路径下即可 内网发送邮件 ...

  10. wcf服务契约的重载

    a. 服务端 .服务端 契约用OperationContract的Name实现重载 using System; using System.Collections.Generic; using Syst ...