MVC: Model-View-Controller Design Pattern used in Struts, Ruby on Rails, etc
70
The Original MVC from Reenskaug of Xerox Parc
Model-View-Controller (MVC) is a classic design pattern originally crafted by Reenskaug at Xerox Parc and implemented later on the Smalltalk Language. It was originally called Thing-Model-View-Editor in a first paper before being called Model-View-Controller in a second paper where Model, View and Controller are defined:
- Model: a human construct that abstracts a real world system to help us better understand them. There are many ways to do so depending on the purposes of the model. In a software, the model is the object that represents the data. The model manages the data and conducts all transformations on that data.
- View: a Representation of a Model. There can be several Views associated with a Model. It interacts with the model via a reference to the model object itself.
- Controller: a link between a User and the System he manipulates by providing the means for user interaction with the data represented by the model. Controller received commands from User and sends messages to views: a view never knows about user input such as keystrokes and mouse operations.
Note that the model has no specific knowledge of either its controllers or its views -- - it contains no internal references to either.
Why MVC ?
On his site Reenskaug says that the structure is meant to be useful "if the user needs to see the same model element simultaneously in different contexts and/or from different viewpoints".
How to implement MVC Architecture ?
The Java programming language provides support for the MVC architecture with two classes:
- Observer -- any object that wishes to be notified when the state of another object changes. The model will be a subtype of Observable.
- Observable -- any object whose state may be of interest, and in whom another object may register an interest. The view will be a subtype of observer.
They provide the mechanism by which the views can be automatically notified of changes in the model. Object references to the model in both the controller and the view allow access to data in the model.
In Web Application Frameworks such as Struts, the model resides in the Business Logic Layer and is implemented with Java Beans, the Views are implemented by JSP pages and the Controllers are implemented by Java Servlets.
MVC Architecture is also the foundation of the new popular framework Ruby On Rails.
![]() | Amazon Price: $34.95 List Price: $59.99 |
![]() | Amazon Price: $27.98 List Price: $49.99 |
![]() | Amazon Price: $28.00 List Price: $54.99 |
![]() | Amazon Price: $28.90 List Price: $44.99 |
CommentsLoading...
I do MVC programming in PHP, but the comment is the same. I wrote a hub about using models or the lack of models which would make MVC programming easier for beginners at http://hubpages.com/hub/Zend-Framework-Do-we-reall











Prof. Chandrakant 3 years ago
the article foub=nd very much intresting and it is really Excellent