日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

OpenDiscussion_DataDrivenDesign

發布時間:2023/12/1 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 OpenDiscussion_DataDrivenDesign 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

本文源于公司內部技術交流,如有不當之處,還請指正。

?

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. Learn more: ?http://www.codeproject.com/Articles/91528/How-to-Call-WCF-Services-Synchronously-and-Asynchr 2 WPF Revolution.  Winform?DataBinding:   http://files.cnblogs.com/cuiyansong/WinformDataBindingDemo.7z?    如果在Winform下開發,實現數據的雙向綁定,當然是依靠委托的方式實現的。底層數據模型提供一個廣播委托Speaker,當數據發生改變時,觸發委托通知。一般來講我們需要構建一個通道用于共享并集中管理通道消息Channel,通道將收集上來的消息發送給監聽者Listener。    ? WPF DataBinding: http://files.cnblogs.com/cuiyansong/DatabindingDemo.7z http://files.cnblogs.com/cuiyansong/Demo_ObservalCollection.7z 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.

轉載于:https://www.cnblogs.com/cuiyansong/p/3437098.html

總結

以上是生活随笔為你收集整理的OpenDiscussion_DataDrivenDesign的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。