Developing ASP.NET MVC Web Applications

Developing ASP.NET MVC Web Applications

COURTESY :- vrindawan.in

Wikipedia

ASP.NET MVC is a web application framework developed by Microsoft that implements the model–view–controller (MVC) pattern. It is no longer in active development. It is open-source software, apart from the ASP.NET Web Forms component, which is proprietary.

ASP.net MVC Introduction Wikilogia (nov 2014)

ASP.NET Core has since been released, which unified ASP.NET, ASP.NET MVC, ASP.NET Web API, and ASP.NET Web Pages (a platform using only Razor pages). MVC 6 was abandoned due to Core and is not expected to be released. Core is currently planned to merge into “.NET 5”.

NET Framework - Wikipedia

Some well known sites that use ASP.NET MVC include Stack Overflow, Microsoft, GoDaddy and Ancestry.com.

Based on ASP.NET, ASP.NET MVC allows software developers to build a web application as a composition of three roles: ModelView and Controller. The MVC model defines web applications with 3 logic layers:

  • Model (business layer)
  • View (display layer)
  • Controller (input control)

model represents the state of a particular aspect of the application. A controller handles interactions and updates the model to reflect a change in state of the application, and then passes information to the view. A view accepts necessary information from the controller and renders a user interface to display that information.

In April 2009, the ASP.NET MVC source code was released under the Microsoft Public License (MS-PL).

“ASP.NET MVC framework is a lightweight, highly testable presentation framework that is integrated with existing ASP.NET features. Some of these integrated features are master pages and membership-based authentication. The MVC framework is defined in the System.Web.Mvc assembly.”

The ASP.NET MVC framework couples the models, views, and controllers using interface-based contracts, thereby allowing each component to be tested independently.

In March 2012, Scott Guthrie announced on his blog that Microsoft had released part of its web stack (including ASP.NET MVC, Razor and Web API) under an open source license (Apache License 2.0).

Guthrie wrote that “Doing so will enable a more open development model where everyone in the community will be able to engage and provide feedback on code checkins, bug-fixes, new feature development, and build and test the products on a daily basis using the most up-to-date version of the source code and tests.”

The source code now resides on CodePlex. ASP.NET Web Forms was not included in this initiative for various reasons.

The view engines used in the ASP.NET MVC 3 and MVC 4 frameworks are Razor and the Web Forms.Both view engines are part of the MVC 3 framework. By default, the view engine in the MVC framework uses Razor .cshtml and .vbhtml, or Web Forms .aspx pages to design the layout of the user interface pages onto which the data is composed. However, different view engines can be used. Additionally, rather than the default ASP.NET Web Forms postback model, any interactions are routed to the controllers using the ASP.NET Routing mechanism. Views can be mapped to different URLs.

Other view engines:

  • The MVCContrib library contains 8 alternate view engines. Brail, NDjango, NHaml, NVelocity, SharpTiles, Spark, StringTemplate and XSLT.
    • The StringTemplate View Engine utilizes a .NET port of the Java templating engine, StringTemplate.
    • Spark is a view engine for the ASP.NET MVC (and the Castle Project MonoRail) frameworks.
    • NDjango is a port of the Django web framework’s templating language to .NET. It is written in F# and comes with Visual Studio extension including full Intellisense support.
  • Naked Objects for .NET is an implementation of the naked objects pattern using ASP.NET MVC.                                                                                    A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build and deploy web applications on the World Wide Web. Web frameworks aim to automate the overhead associated with common activities performed in web development. For example, many web frameworks provide libraries for database access, templating frameworks, and session management, and they often promote code reuse. Although they often target development of dynamic web sites, they are also applicable to static websites.As the design of the World Wide Web was not inherently dynamic, early hypertext consisted of hand-coded HTML text files that were published on web servers. Any modifications to published pages needed to be performed by the pages’ author. In 1993, the Common Gateway Interface (CGI) standard was introduced for interfacing external applications with web servers, to provide a dynamic web page that reflected user inputs.

    Original implementations of the CGI interface typically had adverse effects on the server load however, because each request started a separate process. More recent implementations utilize persistent processes amongst other techniques to reduce the footprint in the server’s resources and offer a general performance boost.

    In 1995, fully integrated server/language development environments first emerged and new web-specific languages were introduced, such as ColdFusion, PHP, and Active Server Pages.

    Although the vast majority of languages for creating dynamic web pages have libraries to help with common tasks, web applications often require specific libraries for particular tasks, such as creating HTML (for example, Jakarta Server Faces).

    In the late 1990s, mature, “full stack” frameworksbegan to appear, that often gathered multiple libraries useful for web development into a single cohesive software stack for web developers to use. Examples of this include ASP.NET, Java EE, WebObjects, web2py, OpenACS, Catalyst, Mojolicious, Ruby on Rails, Laravel, Grails, Django, Zend Framework, Sails.js, Yii, CakePHP, and Symfony.