Choices to Develop ASP.NET Applications
There are several ways to develop ASP.NET, and this has been growing and it tends to continue to grow in order to chose the best approach to the problem in hand, and so I decided to write a little bit about this subject.
So ok, with the introduction of the ASP.NET 3.5 and even with the ASP.NET 2.0 with the AJAX Extensions you had 3 choices to develop ASP.NET Applications, and those were:
- ASP.NET Applications
- This was the best know type of applications without using any AJAX or anything else, just the plain simple ASP.NET Application, and this could be done using 2 types of development, that were the choices on the Visual Studio when beginning the development,
- ASP.NET Web Application
- Application that is pre-compiled and had some advantages in terms of security and performance, because there was no source on the server and just a pre-compiled Assembly, that could be Obfuscated, Signed, and so giving security to the owner that even if someone could gain access to the Site, there was no way ("easy") to change whatever that application was doing. An being a pre-compiled Assembly the application when activating the first time would be faster to load the first time.
- There are more differences but I think these are the most important ones.
- ASP.NET Web Site
- Applications that was not pre-compiles and had advantages when maintaining the applications if the code changes a lot and there are several add-on's to it, of course there are other ways to accomplish that, but this is one. One of the mainly talked problems was the fact of the code being deployed along on the Site, and so this could make that if someone gain access to the site, it could see and change the code as it wish's, and this is not a great thing.
- AJAX Enabled ASP.NET Applications
- This type of applications appeared when the AJAX Extensions (early known as Atlas) gave a AJAX Framework for the ASP.NET Applications, and this is the most used type of applications when developing ASP.NET Applications, because it's easy to change already built applications and increasingly enabling AJAX, like using Update Panels, AJAX Control Toolkit extenders and doing this our Application gained a lot more interaction with the User and also a richer user experience, as for calling it RIA's (Rich Internet Applications) some will agree and some won't, I'm with the one's who doesn't agree, because in order to make a RIA we need something to help us give a better User Interface, not only the UX (User Experience), although the UX is very important, but something like Silverlight will help us with this.
- This type of applications is greatly used but it has some limitations, because when using Partial Rendering some problems can occur, like History not being update (this can be solved, but is not out-of-the-box), the limitation of the HTTP that only allows a single call by HTTP request, and so even if we use Asynchronous calls this can produce undesired results, like clicking 2 buttons and the second one will make that the result of the first request get lost, even if it made changes in the Server Side. This could prove to be difficult subject.
- It can be done using ASP.NET Web Applications or ASP.NET Web Site
- ASP.NET AJAX Applications
- This is a type of applications that change the Architecture of the ASP.NET Applications, because it will take full advantage of the AJAX Framework, but in order to do this, there's a lot of Javascript to be written, and a lot of changes to be made in order to work properly. And some of the questions are. Is this really worth it? Does this perform better? The answer is not trivial, and it's worth it if the problem in hand really need's to give Users the best UX possible and the project is starting, and other options like Silverlight Applications doesn't solve the problem, and so in this cases is really worth it, other than that I don't think so. About the performance, normally yes, it's better than the AJAX Enabled ASP.NET Application, but the problem always reaches the "Does It Worth the effort?".
- It can be done using ASP.NET Web Applications or ASP.NET Web Site
So these are the types of ASP.NET Applications presented by the ASP.NET 3.5, but with the ASP.NET Extensions there's another one coming, and that's the MVC Framework. The question that can be made is, Is this really a new type of ASP.NET Application? or Is this a new option when building ASP.NET Web Applications?
From what is seen I think it's not a new type ASP.NET Application but a new option for building ASP.NET Web Applications, because it's the implementation of the MVC Pattern, and this can be used depending of the problem in hand, and should be used only when the problem needs this type of Architectural approach, other than that in can be a little tricky. So now we have the possibility of creating ASP.NET Applications using the Web Forms type development or the MVC Pattern type development. And when asked what's the best approach my answer will always be. "Depends on the problem", has it always happens when using Patterns.
But is there any advantage for using one or the other? My answer will be that with the ASP.NET MVC Framework the Unit Testing is a lot easier and with this said, I'll say that this doesn't mean that there's no way to use Unit testing with Web Forms, I'm only saying that it's not so easy.
It would be great to have your thoughts about this subject, so please feel free to comment.