| Model-View-Controller (MVC) is a software approach | | | | serious, otherwise insoluble problem will motivate |
| to website building and display that separates what is | | | | someone like Kuwamoto to get "into MVC [for] |
| called the "application logic" from the actual | | | | desktop GUI programming." For many programmers, |
| presentation. What this means in practice is that it | | | | separation between Views and Models was important, |
| permits web pages to contain just small amounts of | | | | whereas separating out Controllers was in the "more |
| "scripting," or PHP commands for automated actions, | | | | trouble than it’s worth" category. |
| since the presentation portion of the page is separate | | | | About MVC making sense "for the HTML-based |
| and distinct from that PHP scripting. | | | | world," the explanation goes like this: There is physical |
| A few quick definitions are in order. The "Model" | | | | separation between the View, which resides on the |
| means the actual data structures, the various functions | | | | client computer, and the Model that is on the server. |
| that empower your pages to fetch, incorporate and | | | | The logic for responding to user events is typically |
| even update the information in the database you are | | | | handled on the server, so does it even (or ever) make |
| using. The "View" comprises all the information | | | | sense for Models to manage these events? The |
| presented to a website visitor, normally a web page | | | | answer is a definite "no way," so you separate the |
| but possibly a page "fragment" such as a header or | | | | Controller logic from the Model logic. HTML and MVC |
| footer, an RSS (Real Simple Syndication) page or | | | | capabilities can support one another, as they should, |
| some other "page" type. Finally, the "Controller" is the | | | | rather than be looked at as an "either/or" situation. |
| intermediary among the Model, the View and any | | | | Downsides updated, too |
| other necessary resources, all of which work in | | | | There are some unpalatable things about a hybrid |
| concert to reply to an HTTP "request" and generate | | | | approach, of course. There are architectures where a |
| web pages. | | | | single Controller handles every one of the "actions" for |
| Programmers compete, you win | | | | the whole application. A few programmers may see |
| There are already various "coding companies" bringing | | | | this as a "good thing," while plenty of others would |
| the MVC workflow and structure to the application | | | | consider it a necessary evil, at best. Isn’t the "World |
| shelf. Some have a somewhat "loose" approach | | | | of the Giant Switch Statement" one of the very things |
| where Models are not absolutely required. If you can | | | | every engineer in this niche wanted to avoid by |
| live (that is, if your pages can "answer the call") without | | | | adopting object-oriented programming? |
| the additional separation, or if designing and maintaining | | | | With applications like Adobe Flex and others, you have |
| the Models is more complex than you like, you can | | | | these powerful, adaptable engines on the client side |
| simply build your site with just the Views and | | | | that can manage the complex logic-and access web |
| Controllers. Since you can usually incorporate your | | | | services directly. The various forces that propelled the |
| existing scripts, and develop custom core libraries, you | | | | MVC model to the forefront should be reexamined in |
| get to work the way you want. | | | | light of the goals of each individual. It is a powerful, |
| The notion that MVC is competing with HTML is | | | | even necessary, development, but certainly does not |
| incorrect, although some coders and site builders make | | | | presage the "end of HTML." |
| a deal out of "MVC vs. HTML." Regarding RIAs (Rich | | | | For some applications it makes very good sense to |
| Internet Applications, full-featured software packages | | | | separate out Controllers, and for particular components |
| that run in a browser), a leading software geek-Sho | | | | it makes sense to leverage the MVC method. For the |
| Kuwamoto, former Macromedia/Adobe | | | | majority of applications, however, separating Views |
| engineer-opines that "MVC is probably not needed for | | | | from Models is the biggest winner in the workflow. |
| most RIAs [and] is probably overkill for the vast | | | | Since, in the majority of cases, the Model part of the |
| majority of [Adobe] Flex apps." However, he also | | | | application comprises services that reside on an |
| realizes that "MVC actually makes sense for the | | | | entirely different machine, the separation is something |
| HTML-based world." | | | | that you really have no choice about, anyway. Getting |
| Peacemakers, not code warriors | | | | everything to work together to the greater good-the |
| This is hardly the type of "us versus them" talk some | | | | user experience-is the bottom-line goal for the |
| are using, and is much more sensible. Another sensible | | | | scientists and the artists that join forces to push the |
| observation concerns the general tendencies exhibited | | | | Internet forward, often an inch or so at a time. Stay |
| by programmers and engineering managers, a leading | | | | tuned to MVC, and HTML 5, or you will definitely miss |
| one of which is laziness. This means "laziness" in a | | | | something-and it could be soon, too! |
| comparative way, in the expectation that only a truly | | | | |