Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Key risks when using ASP.NET MVC for the first time

Tags:

asp.net-mvc

We are planning to use ASP.NET MVC on a relatively important (to the business) project. The development team comprises 4 developers and a Technical Lead. 2 of the devs and the Tech Lead have worked together before on ASP.NET WebForms project and are confident using that technology.

We cringe a little when we look back at some of the approaches used on some of our first WebForms project (examples include excessive use of UpdatePanels, lack of knowledge of controls such as the ListView, bloated ViewState etc).

It is important that we do not look back on this project in a year and cringe at some of our ASP.NET MVC approaches!

Based on experience, does anyone have any key risks they can cite when using ASP.NET MVC for the first time?

I am thinking about gotchas, lightbulbs that took a while to go on, parts of the framework that you felt you were fighting until you learnt a specific item, that sort of thing.

like image 465
Richard Ev Avatar asked Jun 02 '09 21:06

Richard Ev


People also ask

Can MVC ensure security?

MVC provides a lot of infrastructure support for Forms Authentication. Forms authentication is highly customizable, you can customize everything from the sign in form, to where the credentials are stored and how those credentials are validated.

Is it hard to learn ASP NET MVC?

In asp.net there are two main category 1) Asp.net web forms and 2) asp.net MVC; you can pick any but MVC will be easy for you because it is somewhat similar what yo do in PHP while Web-Forms are easy to work on and likewise.

Why ASP NET MVC is better?

The main advantages of ASP.net MVC are: Enables the full control over the rendered HTML. Provides clean separation of concerns(SoC). Enables Test Driven Development (TDD).


1 Answers

Use Strongly Typed Views and create a new Model for each view

Simple reason: That is to make sure your Model is separted from your View. If you need to do refactoring, you only break one part. So if you have a View called "Latest News", you should have a "LatestNewsViewModel". It's then the job of the controller to get the data from the actual Model/Database and create a View Model that it passed into your views. Also, if you decide that you need additional stuff in your View, you don't have to refactor the entire Data Access Layer, as you only have to change the ViewModel and the Controller action that populates it.

Performance

I recommend checking out this slideshow about performance concerns and optimizations which can make a huge impact.

like image 128
Michael Stum Avatar answered Oct 24 '22 22:10

Michael Stum