Must-read MVC Article |
[eluser]Colin Williams[/eluser]
If you are struggling to understand MVC, stop what you are doing and figure it out before you continue (mis)using a MVC framework. A great place to start might be Jonathan Snook's new article on alistapart.com, "JavaScript MVC". Sure, it focuses on JavaScript, but another tool you need at your disposal is the ability to extrapolate. Jonathan's article offers the clearest breakdown of basic MVC separation I've seen yet (other than maybe the short quote he uses early in the article). MVC is purposely simple. If you think it is complex, you might just be over-thinking it. Here are some gems from the article: Quote:If we had a calendar of events, the event data would be stored in its own object. Methods added to the object abstract the process of interacting directly with the data. And then this is definitely one to consider: Quote:However, there are situations in which Views should handle their own events or run their own methods. For example, a View could have an input range with a slider that allows the user to pick the value. The View handles the logic for that slider interaction and how it displays the resulting value. There’s no need to have a Controller micromanage that interaction.
[eluser]renownedmedia[/eluser]
I never would have considered MVC for Javascript... Good article |
Welcome Guest, Not a member yet? Register Sign In |