Advantages of using ASP.NET MVC
MVC is mainly an architectural designingrnpattern that is used for developing the user interfaces which can bernmaintainable, testable and also reusable. It is used for separation of coder.rnThe full meaning of MVC is Model, View and Controller. MVC actually separatesrnthe applications into three different components like Model, View andrnController.
What is ASP.NET MVC?
ASP.NET MVC is a web framework created byrnMicrosoft which is being used for developing the web applications. ASP.NET MVCrnuse MVC architecture pattern. It has been introduced by Microsoft in the yearrn2009.
What are the Advantages of usingrnASP.NET MVC?
LooselyrnCoupling:
· rnLoosely Coupling representsrnless dependency.
· rnViews in MVC are less dependentrnon models.
· rnWe can easily edit, enhance andrnexpand the application.
rnrn
Separationrnof Concerns (SoC):
· rnFrom the technical point ofrnview, the organization code within the MVC is very clean, granular and organizedrnwhich is helpful of making it easier for a web application in terms ofrnfunctionality.
· rnFrom the developmentrnstandpoint, it promotes a great design as well.
rn
rn
ParallelrnDevelopment:
· rnThis is helpful in developingrnmodels and views in parallel.
· rnMultiple programmers can workrnin parallel on views and models.
· rnIt also helps you to make yourrnapplication development process faster and easier.
rnrn
TestrnDriven Development (TDD):
· rnWith ASP.NET MVC, the developerrnis able to create tests of the web side of the things easily.
· rnTDD is one of the latest andrnupdated development processes which is being used in real-time projects.
· rnIn TDD, the developers will bernguided by the development process.
· rnThere is an additional layer ofrntesting will provide another layer of defence against any unexpected behaviour.
· rnMVC applications will work in arngreater way with TDD because the applications are easy to modify at any pointrnof time with any type of module.
rnSeparation of Code:
· rnIt specified for separatingrnpresentation logic from the database which is related to logic. Using thisrnfeature, it is easy to develop and modify on the website.
· rnIn ASP.NET MVC basedrnapplications, the development process is mainly divided into three differentrnmodules: Model, View, and Controller.
rnrn
Easyrnto Perform with Unit Testing:
· rnThe concept of unit testing isrnbased on the testing for only a certain portion of the web application which isrnmodified.
· rnWe can easily perform UnitrnTesting in MVC based applications of ASP.NET.
rnrn
Searchrnengine Friendly and Stateless:
· rnURL’s are very friendly with SearchrnEngines.
· rnAs MVC is Stateless, it willrnalso remove the pressure of users who initiate multiple web browsers from thernsame window with a session crash.
· rnAlso, MVC holds on to thernStateless web protocol rather than fighting against it.
rn
rn
Worksrnwell with developers with the demand for high degree of control:
· rnWith the help of the MVC, itrnwould be easier to have complete control with what is rendered and there are nornsurprises.
· rnIt will also help developersrnwith the HTML forms to boost the performance in terms of the Web Forms as HTMLrnforms are much smaller than the Web Forms.
Three Different Components of ASP.NETrnMVC:
Model:
· rnModel is using a normal C#.
· rnIt is responsible to handlernbusiness logic, data and database related any changes.
· rnModel represents the shape ofrnthe data.
rnrn
View:
· rnView is responsible for UserrnInterface (UI)
· rnIt displays the data which isrncoming from the Model.
· rnView is an HTML template thatrnis binding and displaying the data with HTML controls.
· rnView contains different typesrnof extensions according to the languages - .aspx, .asp, .html, .cshtml,rn.vbhtml.
· rnASP. NET MVC has threerndifferent types of View – Layout View, Partial View, Normal View
rnrn
Controller:
· rnController can contain actionrnand non action method. It is able to handle the user request coming from thernbrowser, then check the request, identify the action method and ultimatelyrnreturn the respective view.
· rnIt is inherited fromrnControllerBase” class that is present inside the “System.Web.MVC” namespace.