Friday, March 9, 2018

When to use ASP.NET Webforms and ASP.NET MVC

In this article I have explained, When to use ASP.NET Webforms and ASP.NET MVC. We know what is ASP.NET and what is ASP.NET MVC, but we are confused when to favor which technology

Confused


Last week my friend has started a new web based project in .NET, he asked me In which technology he should go ASP.NET or ASP.NET MVC ? 

Now a days everyone talk about ASP.NET and ASP.NET MVC but if we asked them, when to favor which technology ? all goes confused. There is no clear-cut answer, and rightly so. This article will help you to choose between ASP.NET and MVC depend upon your requirement and tell you Advantages / Disadvantages of ASP.NET MVC. Lets start with it.



ASP.NET:

Basically ASP.NET was developed to improve the speed and performance of classic ASP, Microsoft's ASP.NET, one of the most successful web application development frameworks ever.You can use ASP.NET to fast develop and deploy highly scalable, high-performance web applications in a managed environment

When to use ASP.NET

1. RAD – Rapid Application Development

RAD is the strong point of ASP.NET, ASP.NET does not deal with HTML markup directly, rather it gives set of powerful tools to developer to design and develop web application, compiler then convert it to Markup and show it on web application, so developer does have to take care of internal architecture and can develop application rapidly.

2. Cost

When Cost is matter ASP.NET is really helpful to you. As it is bit old technology and start of the web development phase, maximum developer community is aware of it and develop using ASP.NET, where as MVC is newer than comparing with ASP.NET, so there is cost incurred to development with ASP.NET MVC

3. Stable implementation

ASP.NET Web Forms implementation is now a stable and robust with many years of deployment experience. over the year ASP.NET is upgraded and is now more firm and dependable.

Drawbacks/Limitation of ASP.NET


  • Customization is not possible and easy with built in ASP.NET control set.
  • As ASP.NET create its own markup tags while rendering on browsers which is very much different than actual HTML tags so flexibility among cross browser compatibility and devices are less
  • The generation of each control ID is vary framework to framework, which needs to make changes in scripting as well.
  • maintaining data between post back is additional task for ASP.NET, as it's page life cycle is depend upon ViewState
  • Final web page render size is also an issue for ASP.NET as view state increase each page size.
  • ASPX pages has fixed URL render pattern which will slow down SEO and search engine crawling.
  • ASPX page does not render without its code behind, so there is additional load on web page each time

ASP.NET MVC

I have read somewhere, "MVC framework is not efficient unless you're willing to roll up your sleeves and build your own project specific infrastructure ", I think it is really true, MVC is complex for Oldies and Simple for New projects, ASP.NET MVC is support Test-driven development (TDD) . I have discuss some points about ASP.NET MVC below. which includes When to favor, Advantages and limitations.

 When to use ASP.NET MVC

ASP.NET MVC has very scatter structure so code separation is strong point, No doubt ASP.NET MVC has many great features like Bundling, minification, Parallel Development, Test-driven development ( It actually leads to very short development life cycle), Web API (for building HTTP service), URL Routing Scaffolding.
But there are some facts and things that we need to consider before using ASP.NET MVC, so lets consider some priorities while going with ASP.NET MVC

1. Complex form structure

ASP.NET MVC has more hold on HTML so When you want to develop a complex form structure, you can use it, MVC allows for any number of forms on the page

2. Purpose of website is for public

If you are build website or web application targeting to public like banking or reservation then you need to go for MVC as it has very SEO friendly and lightweight.

3. Separation of concerns

When your concern is code separation you can go for MVC as it has very scattered structure with Model, View and controller, here is very less chances of getting things more complex.

4. Different view device wise

If you are targeting you development towards multiple render devices then go for MVC it offer design flexibility so that same web page can be easily render on desktop browser, mobile and smart phone devices in simple render mode

5. Easy Unit testing

As with the help of MVC we can developed loosely coupled application, it is very easy to test each module independently, Dependency Injection is more useful in such cases

6. Easily blend with other technology

ASP.NET MVC has capacity to easily blend with other technology, jQuery and other JavaScript frameworks can be simply add in ASP.NET MVC

7. Automatic Unit Testing

If you want to go for automatic unit testing then ASP.NET MVC is good for you.

Drawbacks and limitation of ASP.NET MVC

- It is not easy to understand and code, within limited time frame
- ASP.NET structure is very much different from MVC it is Difficult to convert an existing site from ASP.NET to ASP.NET MVC.

Facts of life
  • More often practical conditions are not same as hypothec conditions the choice between ASP.NET and ASP.NET MVC is not a single cup of tea, it is vary from project to project and team to team 
  • If you have very large ASP.NET project then do not go for MVC as it is like to build your project from scratch, it may be leads to time and cost wasting
  • If you want to deploy project targeting more user volume and devices then go with MVC 
  • Friendly URL's for SEO with no viewstate and cleaner HTML is the powerful point which leads MVC to perform faster
Finally, There are Pros and Cons for both ASP.NET and ASP.NET MVC, This article is small attempt to put focus on features point. It helps you to take decision easy between these two. But the final Answer is remain same "it depends".

Suggestion and Queries are always welcome

Thanks
KOOOOL

4 comments:

  1. I have read your blog its very attractive and impressive. I like it your blog.

    .Net Online Training

    ReplyDelete
  2. Nice! you are sharing such helpful and easy to understandable blog. i have no words for say i just say thanks because it is helpful for me.



    Dot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery







    ReplyDelete
  3. Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites! wow custom speed test

    ReplyDelete

  4. Thanks, this is generally helpful.
    Still, I followed step-by-step your method in this
    dot net online training
    Dot net online training hyderabad

    ReplyDelete