The 10 Best MVC Tips Ever

来源:互联网 发布:linux 修改用户权限 编辑:程序博客网 时间:2024/04/29 18:56

#1. Learn MVC for iPhone OS

Common conventions

Built up from other design patterns


#2. Use MVC to Divide Work

Implement a big idea

Make manageable pieces 


#3. Don’t Fight the Framework 

Color inside the lines
Make the framework work for you


#4. Don’t Abuse Views 

Views don’t own data
Data display and event capture


#5. Plan for iPhone and iPad 

Divide code into modules
Higher-level design than MV


#6. Strive for Loose Coupling 

Goal is flexibility
Minimizing mutual dependencies


#7. Choose the Right Data Model 
iPhone OS gives you many options
Finding the right fit


#8. Decompose Controller Work 

The right number of controllers
Special iPhone OS controllers


#9. Take Charge of Your Object Graph 

Ownership
Lifecycle


#10. Coordinate State Changes 

Updating model after user actions
Updating views after model changes

0 0
原创粉丝点击