Monday, August 17, 2009

Model, View, Controller (MVC) in Web Applications

Introducing MVC in Web Application.
From this Article You'll build a useful toolkit for handling some core parts of the (MVC) Model, View, and Controller principles. You will be introduced to two effective ways to implement the use of templates in your web applications and how to use templates alongside th MVC toolkit You've just met.

The abbreviations MVC specify M for Model, V for View, C for Controller. MVC is a design pattern which is a description of a reusable solution to a recurring problem given a particular content. The design patterns are made so that while dealing with a large scale web application, the designing of the application may be done in a consistent manner.Thus avoiding complex applications to develop. As we say "Best practicecan be achieved in a tried and tested manner.

In MVC paatern, the three components are kept separate from each other, yet having them talkto one other ina consistent manner. For example: If You need to rework Your web application to work on PDA's instead of web browsers, You can swap out Your view component for one that renders content specially for the PDA rather than the web browser. If You need to accept data via voice input rather than mouse clicks, You can swap out Your controller component for one that Voice XML.

One more advantage of MVC pattern is that issues like debugging to catch hard-to-trace bugs, as well as maintainence programming after release, are made tremendously simpler if there is a separation of logic in sensible places. A complex web application can be made a great deal simpler by separating components as stated above.

The Model
The model is the heart of your web application. In general, it is the suite of classes You have developed to handle the various processes involved in Your Applications behaviour. the Model Connects directly to both the controller and the view. The controller supplies the model with its instructions, the view manipulates the data retrieved from the controller into a human-usable output.

The View.
The view presents data from the model that the user has requested or information that the model considers that the user needs to know. Basically the view is at the user end of the application. The model supplies data directly to the view for display in a manner appropriate to the display device in question. The View connects to the controller to provide the physical rendering of the necessary controls for input to be made to your application in the first place.

The Controller.
The controller offers the necssary input facilities that allow users to get data and requests int directly connects to the model to supply data or request in question.

These model, vew, and controller are handled by the fourth component i.e. infrastucture.

MVC in Web Application.
MVC is an eveolution of the concept of IPO (Input, Processing, Output). The application of MVC in a web context is relatively simpler.The view is represented by the web browser, or rather whst is displayed in it. Upon making a request, be it a simple request for a page or an instruction to update or query a database, the output determined by the model is actually displayed by the web browser.

The Model is represented by Your suite of classes, assuming that You have followed an object-oriented approach in Your Application. In any web language, these classes perform parsing and processing on both input and output. Perhaps confusingly, the controller is also represented by the web browser or rather the users actions within it. Whether just a seires of links or a complex form, the GET and POST requests mad by the user's browser represent the effort to get data into the model in the first place.



Related Links :
Internet Media Solutions l Superhostindo l Jababeka Business l Ayo Kencan l Kesaksian Kristen l Lirik Lagu Rohani Kristen

No comments: