Click here to Skip to main content
15,895,256 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,


Currently I am using normal ASP.NET application 2.0 with three layer architecture which includes UI, Business layer and Data access layer.
My application is online hotel booking which includes webservices.
Now I'm thinking to change framework to 4.0.Is this MVC useful for this?
Posted

Changing framework is not a reason to rewrite your application!
4.0, 4.5 and so on still support ASP.NET Web Form based applications, even adds a few features...
So, I would say - no. Do not get into a needless adventure. Change your platform only with reasons and not because of fashion...
 
Share this answer
 
ASP.NET is the actual web development framework provided by .NET framework. MVC, Web Pages (to be consumed by ASP.NET MVC since ASP.NET 5 a few updates later) and Web Forms (No longer included since ASP.NET 5) are just the derivatives of this framework. What you did miss was that MVC is also a three-layer architecture in ASP.NET, it converts your application's code into three layers as,


  1. Model - model is the data access layer.
  2. View - View is the user-interface of your application.
  3. Controller - The main back-end code for your application; business logic.


You can add the code for your data-access-layer in Model, the code for your user-interface in the Views and the code for your business-logic in the Controller section. There won't be any difference that you will find out in either frameworks; but you will get a lot of more features and functionality in ASP.NET's MVC framework, such as URL Routing, Entity Framework; which can work off-MVC too, and many more such other features.

If you're a newbie, then you can learn ASP.NET MVC from their official documentation[^], or you can read my article on ASP.NET MVC to understand the concept underlying in ASP.NET MVC framework.

Understanding ASP.NET MVC using real world example, for beginners and intermediate[^]
 
Share this answer
 
v2
Comments
F-ES Sitecore 18-Mar-15 7:25am    
You can use url routing in webforms, and Entity Framework is a completely separate technology not tied to any presentation framework; it works with webforms, mvc, WinForm apps, services, console applications etc.
Afzaal Ahmad Zeeshan 18-Mar-15 7:31am    
Didn't you read? Entity Framework; which can work off-MVC too. :)
F-ES Sitecore 18-Mar-15 7:37am    
Maybe it is a language thing, but "off-MVC" isn't how you would normally phase that. The preceding statement was fairly unambiguous; "you will get a lot of more features and functionality in ASP.NET's MVC framework, such as ... Entity Framework". My comment was also partially inspired from the fact that on various forums it is an incredibly common perception that EF is a part of MVC, and people also think that Identity etc is a part of MVC.

Anyway, let's not argue over semantics, you've cleared up what you meant :)
[no name] 18-Mar-15 7:33am    
Business Logic in the Controller will get you to hell with any project size larger than small.
 
Share this answer
 
There are pros and cons to both approaches, however from what I've read WebForms (the proper term for what you call "asp.net", MVC is still asp.net) is being phased out in the new releases of the framework and dev tools. If you're still using asp.net 2.0 then there are already many changes and advancements between what you're using and webforms in .net 4+. I'd definitely recommend you move on from 2.0, but if you want to move on to mvc rather than just update your webforms knowledge then that would be no bad thing, as things tend to be moving in that direction anyway.

You can google "webforms vs mvc" and find a lot of articles that cover some pros and cons, but this is one instance where I would probably recommend against doing research on the net, as almost all articles I have read on this topic are incredibly biased and lacking in any real technical depth. For example any "mvc vs webforms" article that mentions "viewstate" can immediately be ignored :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900