Pros and Cons of using ASP.NET MVC with Entity Framework?

Introducing the ONLY search engine optimization software product that has been 100% PROVEN to dramatically increase your rankings in Google, Yahoo, and Bing. Get it now!

What I really like about ASP. NET MVC is: It forces you to use Separation of concerns Full control of HTML output It's easier to write unit test Very extensible Open Source :D NO VIEWSTATE! That means, faster browsing On the other side, I find WebForms more productive for large enterprise applications full of grids, ajax and web controls.

What I really like about ASP. NET MVC is: It forces you to use Separation of concerns; Full control of HTML output; It's easier to write unit test; Very extensible; Open Source :D NO VIEWSTATE! That means, faster browsing.

On the other side, I find WebForms more productive for large enterprise applications full of grids, ajax and web controls.

2 While your answer is correct "Open Source" and maybe Extensible is the only thing you can't do with WebForms. – jfar Aug 31 '10 at 16:53 True, you CAN do it with WebForms. But it's harded, WebForms was first develop not thinking about html output or unit testing, now that we are on WF4 we got some new features to there problems.

If you want to do TDD on a WF application you need to implement MVP/MVC pattern on your own. ASP. NET MVC gives it out of the box.

Anyway, I like both, I just choose the one who best fit my requirements. – Oenning Aug 31 '10 at 17:39.

I'm learning ASP. NET MVC at the moment on a personal project and am finding it great. I really like: Edit/Display templates Custom extension methods on HtmlHelper for various extras I want Integration with jQuery, making client-side extensions relatively straightforward I'm also trying out EF4.It seems ok, though I would like better support for versioning database changes.

I'm not using the POCO objects either, which means if you display an entity on the UI, you can't use the validation attributes (easily -- you can with a metadata type but it is ugly). I'm tending introduce ViewModel classes between entities and the View anyway, as they allow other types of supplementary data that do not belong in the entity.

Bunch of new stuff like AjaxHelpers and AjaxExtensions that set the stage for some interesting things the community could do with ASP. NET MVC and Ajax. I'd like to see some JQuery love in there, maybe with some MVCContrib as they've been quiet lately.

PROS Found much easier to do with MVC was to have multiple versions of a page that displayed the same data, but in a slightly different format. MVC makes it simple to unit test the logic that is specific to a page. To do so, you simply test the actions in your controllers, which are regular, easy to test classes.

The best part about using an MVC framework is that everything in the web application has a standard structure and it is compartmentalized. CONS If you decide to convert your site to MVC, you may also run into issues trying to maintain existing page addresses. Spending some time writing rules that perform the necessary 301 redirects, because you don’t want to take chances with SEO (Search Engine Optimization).

One of the problems is that MVC frameworks can be incredibly bulky. They require a lot of files for everything to work properly.

The way I see it, you just need one . Cs file (controller) and one . Aspx file (view) to do anything.

Similar to WebForms with a . Aspx and . Cs (codebehind).

I'm not sure where the bloat comes in.. – Omar Aug 31 '10 at 13:56 1 Well if you're going to do it like that what's the point in using MVC at all? – Doozer1979 Aug 31 '10 at 16:02 1 Where's the 'M' in MVC in your viewpoint. You can do it the way you're suggesting, but your application will be a mess and a nightmare to unit test.

Doing it the MVC way means you trade off a slimline app, for easier maintainability. In the long run I know which one I prefer. – Doozer1979 Aug 31 '10 at 16:12.

ASP. NET MVC is around for sometime. Entity framework 4.0 is just released.

There is lot of push for both these technologies from Microsoft evangelists like Scott Guthrie and Scotth Hanselman. Most of the examples of entity framework are shown using ASP. NET MVC as front end.

Entity framework might not be as matured as some of the other ORM technologies like N But I believe it is definately the next big thing that MS is pushing for. Take a look at my blog about getting started with EF code first approach here Here is another link which can be used with existing databse schema and entity framework query databse using entity framework.

With regards to the entity Framework, the early stages of developing apps where the model is frequently changing, is really easy with EF4. You code your models and controllers up first and then the framework can automatically create a basic view, and script up a database for you. This is a real boon to productivity.

Spooks point about bloat is really valid, not sure if this is specific to . NET MVC, but small project can quickly balloon to hundreds of files.

I don't see that there could be any problems using the two together, since they deal with two opposite ends of the application, that shouldn't even need to know that the other exists. If you ASP. Net code is properly factored, it's controllers should not be affected by whether the objects it uses come from EF or some other ORM.

Our group felt simelar when we started out using MVC. But after using it for a while we noticed that we are actually faster cranking sites out. 1) The speration of Views (split into partial views) and Controller makes our dev team crank out stuff faster now.

We have one team working on the DAL and controller and a different team working just on the strongly typed Views with Mocked objects. 2) We noticed less refactoring and less dicussions about site layout through using routes intensively. Everytime the customer wants to change the site we just change the routing and all links adjust automatically.

3) Adding unit tests easily creased our code quality a lot.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions