Hello all lovely people out there, it's been quite a while since my first post.
Currently I'm learning ASP.NET MVC, and thought that it would be great to pen down my learning and experiences in a series of articles.
Well let's start with a brief introduction of MVC.
- MVC is a generic concept, in fact it's an architectural pattern.
- It was originally named as Thing-Model-View-Editor way back in 1979, later it was renamed to MVC.
- It's a powerful means of separating concerns within an application and it applies quite beautifully to Web Applications.
- Its explicit separation of concerns does add a little bit complexity to the application's design (the project structure looks huge with a lot of folders and stuffs), but the benefit which MVC offers outdoes this complexity concern.
So, the next BIG QUESTION, what exactly is MVC.
Well, MVC stands for Model-View-Controller. It's an
architectural patterns used to separate an application into 3 main aspects.
- MODEL: Set of classes that describe the data which we want to work with, as well as the Business Rules related to that data.
- VIEW: User Interface (UI), the stuff visible to the user.
- CONTROLLER: Set of classes that handles communications from the user, directs Models to give back a specific set of data, and controls the overall application. Acts as a 'Relationship Manager'.
HISTORY OF MVC:
- In around 1973, a Norwegian professor, namely Dr. Reenskaug at an institute in Oslo was sitting at a shipyard and was ship spotting to design a better information system.
- He started to formulate an approach to systems design based upon modularity and separation of processes. He wrote a paper on it.
- Later in around 1978-79, he refined his Shipyard ideas and wrote the concepts of MVC.
- Since then, MVC has evolved as one of the most popular architectures in Computer Science.
PRESENCE OF MVC TODAY:
- MVC is used in dozens of frameworks today, on almost all the platforms, be it Windows, MAC, LINUX.
- Ruby on Rails (RoR) uses MVC.
- Django is a framework created using Python as the language and MVC as the architecture.
- In JAVA space, we have Springs and Struts which are based upon MVC.
- Microsoft is a late comer in the MVC domain and they thought why not mingle MVC, and thus came up ASP.NET MVC.
- It's not to be confused with MVC, MVC is an architectural pattern, while ASP.NET MVC is the programming model developed by MS using MVC as the architecture.
- In Feb 2007, Scott Guthrie wrote few lines of code while flying out to a conference, which became ASP.NET MVC after some time.
DILEMMA:
- A common dilemma which exists today: 'Are Web Forms Dead?'.
- No its not, ASP.NET MVC is just another model, and it has not come to replace the traditional ASP.NET Web Forms, but yes it does provide some advantages over the Web Forms.
- However, even today, at many places Web Forms are used.
- Both ASP.NET Web Forms and ASP.NET MVC sit on top of the core ASP.NET Framework. So we shouldn't think that ASP.NET MVC is the replacement of ASP.NET Web Forms.
DIFFERENCES:
- There are significant differences between ASP.NET Web Forms and ASP.NET MVC, but the most important one which comes to my mind is that ASP.NET MVC doesn't work on the event driven methodology which ASP.NET Web Forms work upon.
- ASP.NET MVC works on a more granular level.
- There are no server side controls in ASP.NET MVC, everything is pure HTML, hence there is no over-head required to convert the server side controls to HTML controls (the browser only understands HTML), hence leading to a greater performance.
- ASP.NET Web Forms look out for a physical file on the disk where they are deployed, whereas ASP.NET MVC looks out for functions, Controller Action Methods to be more precise. And MVC does it via Routing (A very big concept in MVC domain).
This is all for the intro article, stay tuned for the next one.

No comments :
Post a Comment