Microsoft ASP.NET Framework
The .NET framework contains tens of thousands of classes which can aid the developer in interacting with the file system, access databases, or generating images (Walther, 2010).
Figure 1: ASP.NET Frameworks (Walther, 2010)
As shown in Figure 1 the ASP.NET framework is an extension to the base .NET framework it is separate from the .NET framework as it provides classes for building web applications; projects which are not web based will not require the functionality the ASP.NET classes provide. Also shown in the ASP.NET framework stack is two additional frameworks for building web applications on top of the ASP.NET framework, ASP.NET Web Forms, and ASP.NET MVC (Walther, 2010).
ASP.NET MVC
The architects of ASP.NET MVC realised the importance of producing standards-compliant code, and the framework enables the developer to do so (Sanderson, 2009). However this comes at a cost, the maturity of ASP.NET WebForms has seen it provide many prebuilt server side controls for the developer to drag and drop onto a page, providing rich functionality with very little effort. By allowing the developer full control over the HTML these prebuilt controls are missing from ASP.NET MVC forcing the developer to hand craft their HTML requiring more time and more effort.
Users are able to access web sites using multiple technologies; they may traditionally access a site through a browser on a personal computer, or by using a mobile device such as a PDA or phone. ASP.NET MVC separates the model from the user interface; therefore multiple views can be implemented upon a single model (Buschmann et al., 1996). This advantage occurs due to the combination of the observer and strategy patterns and potentially helps resolve one of the problems with web system development, the problem that developers are unable to predict how end users will access the system (Kappel et al., 2004).
An ASP.NET MVC application is built as a collection of individual components each separating out independent concerns, and working together through the use of interfaces or abstract classes. Very much like a computer where it is possible to replace graphics cards or hard disks from varying manufacturers, it becomes possible to change a components underlying technology without affecting the rest of the system (Sanderson, 2009). This analogy suits the web domain extremely well just as hardware advances and a system may require an upgrade so does software. For example the development team in the future may feel that the design of their system no longer fits with the ever emerging web trends, and that they wish to update their HTML with AJAX views to Silverlight or Flex. The core functionality of the system does not need to change. It is still perfectly usable and by uncoupling the view it allows this evolution to become much simpler (Sowell, 2009).
Users are unlikely to access a web application in a traditional manner; this introduces an additional focus to the cleanliness and understandability of web system URL’s to enable users to grasp where they have entered a site. ASP MVC’s routing engine allows a developer to configure bespoke URL’s for any part of their web system without physically renaming files or folders. Whilst traditional ASP.NET WebForm URL’s may use a URL such as sportsstore.com/sports.aspx?action=show&cat=1 an ASP.NET MVC could use /football/kits/manchester-united. The advantage to the ASP.NET MVC URL is that search engines give considerable weighting to the keywords in a URL, meaning a search for football kits is more likely to turn up the ASP.NET MVC version of the URL and attract potential customers.
Software development in the last decade has seen a significant shift towards agile methodologies (Sanderson, 2009) with Conery et al. (2009) stating that unit testing should be part of a development teams everyday lifecycle. Test-driven development is an example of this, whereby developers write automated tests before writing their actual code. The advantage is that when developers need to respond to change such as new features, or altering the logic in parts of code, the new behaviour of the application can be tested and validated against an already defined set of automated tests, which encapsulate the desired behaviour of the application. As the MVC architecture separates concerns it allows for unit testing to become much simpler as by using the MVC architecture the developers will naturally separate different application concerns into separate independent software pieces (Sanderson, 2009).
Web systems are known to have a characteristic called the ‘perpetual beta’. The ‘perpetual beta’ is where a web system is never a final version, improvements and new features are constantly being built and implemented as part of a continual cycle, abolishing the traditional version release cycle. By allowing for easier testing the perpetual beta cycle can become more controlled, developers will be able to add new features and functionality to the existing code base without fear of breaking the system they already have (Walther, 2010).
All of the advantages to ASP.NET MVC inevitably adds increased complexity. The development team now have to understand the patterns used within the MVC architecture, and understand why they are to separate the code they are writing. If they fail to understand developers could be lured into the pattern trap where they start to tangle concerns without realising, producing spaghetti code which is difficult to maintain and test.
Web development teams are likely to consist of many staff members from different backgrounds and skill sets. As an MVC architecture separates out concerns it also allows the separation of responsibilities. In terms of a web development project the web developer or HTML specialist can be left to build the views, whilst a traditional developer from a computer science background can build the core functionality of the system in the model section of the project (Freeman et al., 2004) (Walther, 2010). This can be a significant advantage when working on large projects in large teams as concurrent development on all parts of the application can occur.
ASP.NET WebForms
ASP.NET allows developers to create a user interface as a set of server side controls each of which kept track of their state across each HTTP request (Walther, 2010). By offering server side controls which render themselves as HTML, the developer has less control over the HTML which is produced. This often leads to HTML which fails to comply with web standards, and makes the increasingly popular CSS technology difficult to work with (Walther, 2010) (Conery et al., 2009). Many developers also face browser compatibility issues when developing public facing web sites (Varghese, 2008).
Web standards are becoming increasingly important, web developers cannot predict the browser or device the user will access their web system with. This puts an increased pressure on complying with web standards to ensure a system will be compatible across all vendors browsers and device offerings (Walther, 2010). However ASP.NET allows developers to build web systems with minimal knowledge of HTML and JavaScript all the developer needs to know is the basics of the .NET environment, and the programming interface of some the server controls (Esposito, 2009).
The style of ASP.NET development lends itself well to Rapid Application Development. The support of tools such as Visual Studio 2008 which enables drag and drop development significantly increases productivity (Appel, 2009) (Esposito, 2009).
The technology which allows a control to maintain its state thus abstracting the internets stateless nature is known as ViewState. ViewState works by storing a controls state as a hidden and encoded part of a webpage. This however sometimes results in hundreds of kilobytes of extra data being transferred between the client and the server on every request, resulting in long loading times (Walther, 2010) (Appel, 2008) (Varghese, 2008). Unless the viewstate is managed intelligently it can hamper a sites performance, with its additional data it was not designed to work with the stateless model of the web, but against it.
ASP.NET does provide some separation of concerns by using a code behind model which allows a developer to separate application code from the HTML markup. However whilst being an extremely good idea the reality in some applications is that the code behind files leads to spaghetti code and a false sense of separation of concerns, with presentation code and application logic being in the same code behind class (Walther, 2010).
When ASP.NET was designed and released it would not have been possible to predict the movement towards agile methodologies, and that testing would become an important part of software development (Walther, 2010) (Conery et al., 2009) (Varghese, 2008). This has lead to one of the major downside of ASP.NET, its architecture is not designed to support automated testing, despite being possible it is extremely hard to implement (Esposito, 2009).
ASP.NET WebForms or ASP.NET MVC
Despite the weaknesses of ASP.NET and the strong advantages of MVC, the choice of technology ultimately depends on the type of project being undertaken. If the project has an existing legacy code base running an ASP.NET website, than rewriting the application as an ASP.NET MVC application would be unsuitable in most scenarios, and it would be more sensible to stick to ASP.NET (Bhide, 2008).
ASP.NET WebForms suits a rapid application development style which fits the fast paced development environment web systems experience; if the project requires a site to be delivered quickly ASP.NET WebForms would be the most suitable choice. ASP.NET MVC introduces additional complexities in comparison with ASP.NET WebForms which leads to longer development cycles (Bhide, 2008). However the additional complexities of ASP.NET MVC could be justified for example if the web system is expected to have the ‘perpetual beta’ characteristic. The separation of concerns and a solid testing base would provide more control over the evolution of the system.
Developer ability and experience also impacts the decision. An experienced developer from a software engineering background is likely to understand the software patterns ASP.NET MVC uses, and is more likely to find ASP.NET MVC easier to develop with than ASP.NET WebForms. However on the other hand a developer not from software engineering background, such as the developers found in many web systems projects may find ASP.NET MVC confusing, and are more likely to be suited to the simple development style of ASP.NET WebForms (Bhide, 2008).
If accessibility is a requirement then ASP.NET MVC’s advantage of giving the developer full control over the HTML markup, makes ASP.NET MVC a good choice. Strict control of HTML is not possible with ASP.NET WebForms causing accessibility compliant markup to become more difficult (Esposito, 2009).
Where the application is due to be deployed can also influence the technology choice decision. The heavy bandwidth issue of ASP.NET is not an issue when it comes to small web sites or intranet applications but for large complex web applications it may significantly affect performance resulting in loss of clients. ASP.NET MVC has some advantages for web systems in that the routing system enables search engine optimisation which can be crucial for attracting new users. Its architecture also suites the statelessness of the web, not requiring viewstate and not leading to the heavy bandwidth issues ASP.NET WebForms experiences.
Works Cited
Anon., 2007. Model View Controller. [Online] Available at: http://www.phpwact.org/pattern/model_view_controller [Accessed 26 February 2010].
Appel, R., 2008. ASP.NET Development: MVC vs Web Forms. [Online] Available at: http://rachelappel.com/asp-net/asp-net-development-mvc-vs-web-forms/ [Accessed 1 March 2010].
Appel, R., 2009. Choosing Between ASP.NET Web Forms & MVC. [Video] Available at: http://videos.visitmix.com/MIX09/T23F [Accessed 1 March 2010].
Bhide, R., 2008. MVC vs. regular ASP.NET. [Online] Available at: http://techkn0w.wordpress.com/2008/05/15/mvc-vs-regular-aspnet/ [Accessed 1 March 2010].
Burbeck, S., 1992. Application Programming in Smalltalk-80(TM): How to use Model-View-Controller(MVC). [Online] Available at: http://st-www.cs.illinois.edu/users/smarch/st-docs/mvc.html [Accessed 26 February 2009].
Buschmann, F. et al., 1996. Pattern-Oriented Software Architecture. 1st ed. Chichester: Wiley.
Conery, R., Hanselman, S., Haack, P. & Gurhrie, S., 2009. Professional ASP.NET MVC 1.0 (Wrox Programmer to Programmer). Indianapolis, Indiana, United States of America: Wiley.
Esposito, D., 2009. Comparing Web Forms and ASP.NET MVC. [Online] Available at: http://msdn.microsoft.com/en-us/magazine/dd942833.aspx [Accessed 1 March 2010].
Freeman, E.T., Robson, E., Bates, B. & Sierra, K., 2004. Head First Design Patterns. 1st ed. O’Reilly Media.
Holzner, S., 2006. Design Patterns for Dummies. Hoboken, New Jersey, United States of America: Wiley.
Kappel, G. et al., 2004. Web Engineering – Old wine in new bottles? In Proceedings of the 4th International Conference on Web Engineering., 2004. Springer-Verlag.
Sanderson, S., 2009. Pro ASP.NET MVC Framework. New York, United States: Springer-verlag.
Sintes, T., 2001. Speaking on the Observer pattern. [Online] Available at: http://www.javaworld.com/javaworld/javaqa/2001-05/04-qa-0525-observer.html [Accessed 26 February 2010].
Sowell, E.B., 2009. What is the Model-View-Controller Pattern? [Online] Available at: http://www.howmvcworks.net/GettingStarted/WhatIsTheModelViewControllerPattern [Accessed 28 February 2010].
Varghese, S., 2008. ASP.NET MVC Vs ASP.NET Web Form. [Online] Available at: http://weblogs.asp.net/shijuvarghese/archive/2008/07/09/asp-net-mvc-vs-asp-net-web-form.aspx [Accessed 1 March 2010].
Walther, S., 2010. Sams ASP.NET MVC Framework Unleashed. United States of America: Sams Publishing.

It‘s quite in here! Why not leave a response?