1、MVC,容易造成Massive View Controller。
2、MVVM,數(shù)據(jù)綁定使 Debug 變得更難了。數(shù)據(jù)綁定使程序異常能快速的傳遞到其他位置,在界面上發(fā)現(xiàn)的 Bug 有可能是由 ViewModel 造成的,也有可能是由 Model 層造成的,傳遞鏈越長,對 Bug 的定位就越困難。
3、APESubject是科目的資源結(jié)構(gòu),包含了 Subject 的 id 和 name 等資源屬性,這部分屬性是用戶無關(guān)的;APEUserSubject是用戶的科目信息,包含了用戶是否打開某個學科的屬性。
@interface?APESubject?:?NSObject
@property?(nonatomic,?strong,?nullable)?NSNumber?*id;
@property?(nonatomic,?strong,?nullable)?NSString?*name;
@end
@interface?APEUserSubject?:?NSObject
@property?(nonatomic,?strong,?nullable)?NSNumber?*id;
@property?(nonatomic,?strong,?nullable)?NSNumber?*updatedTime;
///??On?or?Off
@property?(nonatomic)?APEUserSubjectStatus?status;
@end
文/喜歡就可以(簡書作者)
原文鏈接:http://www.itdecent.cn/p/dcbebd09e5da
著作權(quán)歸作者所有,轉(zhuǎn)載請聯(lián)系作者獲得授權(quán),并標注“簡書作者”。
4、每一個 ViewController 都會有一個對應的 DataController,這一類 DataController 的主要職責是處理這個頁面上的所有數(shù)據(jù)相關(guān)的邏輯,我們稱其為 View Related Data Controller。