How can I do rapid application development with ASP.NET MVC?

17,005

Solution 1

There really are no good answers.

I'd be very surprised if you could recreate a non-trivial business application in a new format (web) in any 'short' amount of time (unless you measure 'short' to be 6 months).

ASP.NET MVC provides (hands down) the most convention available with any beginning web project.

ASP.NET lets you drag-and-drop to get things working, but it breaks maintenance horribly for non-trivial applications.

If it were me, I'd do three things:

  1. Ask my boss if he wants me to recreate an entire business application across a completely different platform.

  2. Tell him he can either have it more quickly now (ASP.NET), or more quickly later (ASP.NET MVC).

  3. Let him make the call.


Personal Addendum: I've used both ASP.NET and ASP.NET MVC for web applications. MVC is just better. Not faster, but better. It made web development 'fun' again for me.

Solution 2

MVC isn't really a RAD development framework.

You'll be writing much more infrastructure code than the RAD Webforms alternative of dragging a datagrid and a datasource onto a .aspx page. I love MVC but if you're under the gun go with Webforms. MVC can be faster, but only if you have infrastructure pre-built.

MVC 2 alleviates some of this by including Model based HTML helpers like Model.EditorFor() but it's not good enough yet. No quick grid code. Paging? You're rolling your own pager. Ajax? Write your own JQuery.

Sure, there are 3rd party and open source libraries available for all this stuff but in my experience smushing them all together and making sure they play nice is also time consuming.

Solution 3

Simple web application + tight schedule = ASP.NET webforms.

Complex web application + tight schedule = ASP.NET MVC.

I've found that as the complexity of a web app increases linearly the complexity of a webforms app increases exponentially. Once you start writing your own server controls (NOT user controls, as those are still relatively simple), which can be necessary for more complex UI, you need to have an intimate knowledge of the whole page lifecycle, how the viewstate works, and other obscure parts of webforms that the framework abstracts from you.

MVC, while it requires you know HTML well, does great on the tail end of complexity. No matter how complex the application is, you're still dealing with POCOs and methods in your controller. Once you get over the initial hurdles, its smooth sailing. Development difficulty increases at the same pace as website difficulty.

Personal experience: I converted a relatively complex website using custom server controls to ASP.NET MVC and cut the codebase in half. I also drastically reduced the complexity of the code as well.

The only caveat I have is that ajax is easier to do using ASP.NET AJAX. So if you're going to develop a web app that relies heavily on ajax then webforms may just beat MVC.


Migrating from ASP.NET to MVC isn't always the easiest. You have to move from a codebehind-based application to one where your controllers are unaware of your UI. Also, MVC relies heavily on the URL to determine the intent of the user, whereas ASP.NET relies on event handlers.

Personally, if I felt an application was destined to be MVC, I wouldn't waste time developing it in ASP.NET. But then, I've had the benefit of getting past the initial learning curve. Which wasn't all that bad IMHO. I had more trouble learning all the HTML and HTML forms that ASP.NET kept me from learning.

Solution 4

With this deadline i think it's more convenient to use the ASP.Net Webform. After this first phase with more time/budget you can start to develop new parts of your application using the MVC since they can coexist.

Also be aware of the Ajax and grid code. In MVC they usually take longer to develop but also at least for me they appear to be more robust because you really have to know what you're doing.

This question is from 2009, would be nice if the author give some feedback of his decision.

EDIT: Take a look into http://mvcscaffolding.codeplex.com/ if you still need a RAD using asp.net MVC.

Share:
17,005

Related videos on Youtube

Erik Forbes
Author by

Erik Forbes

Updated on January 05, 2020

Comments

  • Erik Forbes
    Erik Forbes over 4 years

    I've been given a short amount of time (~80 hours to start with) to replace an existing Access database with a full-blown SQL + Web system, and I'm enumerating my options. I would like to use ASP.NET MVC, but I'm unsure of how to use it effectively with my short timetable.

    For the database backend I'll be using Linq to SQL as it's a product I already know and can get something working with it quickly.

    Does anyone have any experience with using ASP.NET MVC in this way and can share some insight?

    Edit: The reason I've been interested in ASP.NET MVC is because I know (100% confirmed) that there will be more work to do after this first round, and I'd like my maintenance work to be as easy as possible. In my experience Webforms applications tend to break down over repeated maintenance, despite discipline.

    Maybe there's a middle ground? How difficult would it to be for me to, say, build the app with Webforms, then migrate it to MVC later when I have more time budgeted to the project?

    Edit 2: Further background: the Access application I'm replacing is used in some capacity by everyone in the building, and since it was upgraded from Access 98 to 2003 it's been crashing daily, causing hours of lost productivity as people have to re-enter data since the last backup. This is the reason for the short amount of time - this is a critical business function, and they can't afford to keep re-entering data on a daily basis.

    • LiamB
      LiamB over 14 years
      What do you want to know? If you have a short time, learning a new framework and method of doing things is not going to be a good idea!
    • George Stocker
      George Stocker over 14 years
      It's going to take you longer than you think; but with ASP.NET MVC you can be up and running rather quickly -- if you know ASP.NET MVC. However, none of the things outside of the data layer transfers. You're going to have to come up with a new UI and Controller logic. RAD doesn't help you here; it's a whole new paradigm.
    • RichardOD
      RichardOD over 14 years
      I think once you've got enough code in place, using ASP.NET MVC can become very RAD like.
    • George Stocker
      George Stocker over 14 years
      @Erik: Building it with Webforms and rebuilding it with MVC later will never happen. Quite simply, it'll be a complete re-write. The paradigms are just too different. There will be very little you could re-use.
    • Admin
      Admin over 14 years
      @Geo +1, but it all depends on how tightly linked your code and the UI is linked. If you keep your codebehind as slim as possible and keep your logic as ignorant of the UI as possible you can reuse a significant portion of it. But it definitely is a very different paradigm and you will definitely have issues if you rely heavily on the codebehind.
    • George Stocker
      George Stocker over 14 years
      @Will I'm thinking about those that use the <asp: /> controls; none of those can be reused without getting close to breaking the separation of concerns with view and controller (and in most cases, breaking it). Heck, even with the <asp:ListView> you break the separation between view and Controller; and that's arguably the least 'Webforms' table control there is.
  • George Stocker
    George Stocker over 14 years
    ASP.NET MVC provides the infrastructure (see: Convention over configuration). With Drag & drop Linq-To-SQL, you already have half the model done. The infrastructure is there -- but you do have to be competent in understanding MVC, and you can't just rely on drag and drop controls that take the programming out of programming.
  • John Farrell
    John Farrell over 14 years
    Lol, MVC provides the infrastructure, look at this Linq to Sql feature? And anyway, we are not talking about why drag and drop is bad, we are talking about if drag and drop is faster.
  • Erik Forbes
    Erik Forbes over 14 years
    Edited my question with some more background.
  • Erik Forbes
    Erik Forbes over 14 years
    Edited my question with some more background.
  • Erik Forbes
    Erik Forbes over 14 years
    This is what I'm going to do - I've explained the situation to him, explained the tradeoffs involved between the conflicting goals (speed of development vs cost of maintenance) and asked him for his recommendation.
  • Erik Forbes
    Erik Forbes over 14 years
    Also - I've been given 80 hours for now. Not a lot of time. =X
  • George Stocker
    George Stocker over 14 years
    @Erik : I don't like to speak in absolutes, but unless this is an insanely trivial application, I'm not sure you could ever do it in 80 hours.
  • Erik Forbes
    Erik Forbes over 14 years
    It's not, and I don't think so either. Tomorrow I'm going to email my boss and tell him I'm going to need more time.
  • Erik Forbes
    Erik Forbes over 11 years
    It ended up not being my decision. I left the company before they began their conversion, and they did indeed go with ASP.NET MVC. Thanks =)