In: Computer Science
Software Design
When is the model-view-controller pattern better than the client-server pattern? Why? Justify your answer.
When is the model-view-controller pattern better than the client-server pattern? Why? Justify your answer.
Why Is Model-View-Controller so Important?
The MVC architectural pattern is not directly related to web applications. In fact, it’s quite common in Smalltalk applications, which generally have nothing to do with the Web. As we saw in the previous section, the Model 2 approach is concerned with separating responsibilities in web applications. Allowing a JSP page to handle the responsibilities of receiving the request, executing some business logic, and then determining the next view to display can make for an unattractive JSP page, not to mention the maintenance and extensibility problems this entanglement causes. Application development and maintenance are much easier if the different components of a web application have clear and distinct responsibilities.
Client/Server Pattern
Basically all web systems follow this model. The web system, as a server, responds to all requests sent by different clients(browers, crawler, etc), using standard protocols. Clients’ requests are considered independent of each other. This means when the server is constructing the response to a request sent from one client, it doesn’t need to consider the requests from other clients or other requests from the same client, but only the information contained in this request, and probably the information stored in the database or file system on the server side.