Model-View-Controller (MVC) is probably one of the most quoted patterns in the web programming world in recent years. Today, we’ll clarify what MVC means, and why it has become so popular. The most obvious advantage we gain using MVC is a clear separation of presentation (the interface with the user) and application logic.
ASP.NET MVC is next generation technology to develop loosely coupled, test driven development approach to develop web applications. Test driven approach allows testing team to test database model without UI layer. Testing team can write automated test cases directly against model and controller while development team can work on UI. This makes true parallel development cycle which results in time saving across the application development life cycle and client will receive the result in over all lesser time.
ASP.NET MVC is not a new concept and many open source technology had introduce MVC development from many years. Microsoft launched MV before couple of years and it become very popular among developers and customers. After receiving overwhelming response Microsoft has introduce 4th version of MVC and now current version is MVC 4.
Concept of MVC was first invented by Smaltalk programmer. Nowdays the MVC its one of the most popular and very useful pattern. If you are wirting software, than you should know it. Unfortunately its one of the hardest to understand. ASP.NET MVC is an architecture to develop ASP.NET web application in a different manner than the traditional ASP.NET web developement. Web applications developed with ASP.NET MVC are even more SEO (Search Engine) friendly.
The MVC consist of main three fundamental parts.
Where, M stands for Model – its data
Where, V stands for View – its An interface to view and modify the data
Where, C stands for Controller - Operations that can be performed on the data
The MVC pattern, in a nutshell, is this:
1.The Model represents the data, and does nothing else. The Model does NOT depend on the controller or the view.
2.The View displays the model data, and sends user actions (e.g. button clicks) to the Controller.
The view can:
1.be independent of both the Model and the Controller; or
2.actually be the Controller, and therefor depend on the Model.
3.The Controller provides Model data to the View, and interprets user actions such as button clicks. The Controller depends on the View and the Model. In some cases, the Controller and the View are the same object.
Models represent knowledge. A Model could be a single object or it could be some structure of obejcts.There should be a one-to-one correspondence between the model and its parts on one hand, and the represented world as perceived by the owner of the model on the other hand.
1.Model is basically a C# or VB.NET class
2.A Model is accessible by both controller and view
3.A Model can be used to pass data from Controller to view
4.A View can use Model to display data in page.
A View is a (visual) representation of its model. It would ordinarily highlight certain attributes of the Model and suppress others. It is thus acting as a presentation filter.
A View is attached to its Model (or model part) and gets the data necessary for the presentation from the Model by asking questions. It may also update the model by sending appropriate messages. All these questions and messages have to be in the terminology of the model, the view will therefore have to know the semantics of the attributes of the model it represents.
1.View is an ASPX page without having a code behind file
2.All page specific HTML generation and formatting can be done inside view
3.One can use Inline code (server tags ) to develop dynamic pages
4.A request to view (ASPX page) can be made only from a controller’s action method
A Controller is the link between a user and the system. It provides the user with input by arranging for relevant views to present themselves in appropriate places on the screen. It provides means for user output by presenting the user with menus or other means of giving commands and data. The Controller receives such user output, translates it into the appropriate messages and pass these messages on to one or more of the views.
1.Controller is basically a C# or VB.NET class which inherits system.mvc.controller
2.Controller is a heart of the entire MVC architecture
3.Inside Controller’s class action methods can be implemented which are responsible for responding to browser OR calling views.
4.Controller can access and use model class to pass data to views
5.Controller uses ViewData to pass any data to view
Article Source: http://www.abcarticledirectory.com
Still Searching? Last Chance to find what you're looking for with a Google Custom Search!
Or.... You can search this site using our Bing Custom Search!
Did You Like/Dislike This Article? Give It YOUR Rating!
Please Rate this Article
5 out of 54 out of 53 out of 52 out of 51 out of 5
No Ratings Yet. Be The First To Rate This Article