Android的視圖與數據模型綁定 - Android Binding

jopen 12年前發布 | 23K 次閱讀 Android Android開發 移動開發

Android Binding 提供了一個通用的框架用來實現 Android 的視圖部件跟數據模型進行綁定的功能,用來實現 Android 應用程序的 MVC 模式。

Android-Binding is a MVVM (Model-View-ViewModel) framework, that helps freeing the Activity from working directly to User Interfaces. As an Activity, it's job is only to supply the ViewModel that the View requires to render the result while ViewModel is a class that with zero direct coupling with the View (and actually you might supply a different View to it).

關鍵特性:

  • Declare view binding in Layout XML files. No additional files needed.
  • Helps implements MVVM
  • Much easier for Unit-Testing
  • Model Validation that validates against ViewModel
  • Support Cursor results, and you can even validate the cursor result!

項目主頁:http://www.baiduhome.net/lib/view/home/1341221472574

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!