Android的视图与数据模型绑定 - Android Binding

jopen 12年前

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.open-open.com/lib/view/home/1341221472574