It's something I've been thinking a lot about lately and was excited to find someone had written about it. The article is short sweet and to the point, but for the tl;dr generation I'll summarize it here:
- model: (a) All data sits in model. (b) Fires events when data changes. [server-side communication happens here. knows nothing about DOM.]
- view: (a) Listens to model events. (b) Calls handlers in controller. [all DOM interaction happens here. don't use ids, so that views can be reusable within same page. knows nothing about state/logic.]
- controller: (a) Decides how to respond to user interaction. (b) Modifies the model. [abstract logic]
No comments:
Post a Comment