tags:

views:

285

answers:

8

What are the biggest problems that is being encountered with ASP.Net MVC and what have you done to work around them?

So far my biggest problems are:

Problem: Keeping up with the changes (RCx, beta, etc).

Workarounds: Compiling till it works.

Problem: Remembering and dealing with the Futures DLL.

Workaround: Download the latest, compile till it works.

A: 

You realize you are using preview/beta/RC software, right? It is to be expected that things will change.

Most of the problems I have encountered in working with ASP.NET MVC over the past year or so have been a result of my ignorance. Preview 2 -> Preview 3 was a real pain, but that was about it.

Right now, the only thing I really fight with is

return Json(data);

It sees circular loops in my data when I really can't find any. I'm sure there's some behavior that I'm not aware of causing this, so I'm attributing this to my own ignorance still. Maybe if there were some way to tell it to ignore certain properties, I could work around this without having to build a Dictionary/List every time I want to return JSON from an action.

Another thing that I really don't have a problem with, but I remember a lot of people whining about, is that so many methods take anonymous objects. Namely route definitions. Intellisense doesn't tell you what kinds of key/value pairs a method expects in its anon. objects, so it can be difficult to use if you aren't familiar with the framework.

Stuart Branham
With preview lots will change, with beta some things will change, and with RC not much will change. It's RC.
Anthony
Actually, it's RTM
Richard Szalay
Yeah, as of this week. It wasn't when I wrote this answer. :P
Stuart Branham
+3  A: 

I haven't had any real problems. That said I have written my own library of useful helpers to make life much easier for me. Most of it is similar to the futures library, but i think i've taken mine much further. It mainly revolves around integrating form components, model binders and validators together so that you can get a fully working, validating CRUD page within seconds with minimal code.

I quite like the fluent validation

Rules(
    Ensure(x => x.Date).IsLessThan(DateTime.Now), 
    Ensure(x => x.Telephone).HasMinimumLength(12),
    Ensure(x => x.Email).IsValidEmailAddress()
    );

That said, futures by itself is an excellent package and makes mvc a great tool to use. I think the main problems with it are the lack of comprehensive tutorials and documentation. As its relatively new and been through so many breaking changes recently that many blog posts on the topic are out of date.

I think once its hit RMT things should get easier for beginners.

Andrew Bullock
+1 I can get this Rules code somewhere? Or is this your custom work?
tyndall
It is my own work but its not complete enough yet to release, I'm considering releasing it on codeplex or somewhere, might even suggest it to mvccontrib. Stay tuned
Andrew Bullock
You can try the .net validation framework on codeplex. Get the latest source and compile the "SplitBranch". Post questions/probs to the forum as its still being developed. The framework does both server and client side validation, unlike above. Andrew, if you interested, you'd be welcome to join.
TheDeeno
A: 

Check out this link, where Phil Haack and Jeff Atwood do a presentation of MVC. Since Jeff used ASP.NET MVC for this site, it is worth checking out.

JosephStyons
A: 

I love the fact that it is cutting edge and I even enjoy the challenge of upgrading my apps (although sometimes I push it off 'till I have more time).

what bothers me sometimes is the lack of mature controls that would make simple recurring tasks (think validation, data binding) much easier.

But never during my day do I regret using MVC or even consider using webforms. I am hooked on asp.net mvc and haven't made anything larger than a single form on anything else fro over a year.

Sruly
+1  A: 

Documentation, documentation, documentation. Additionally we need a one stop place for best practices beyond the basic beginner stuff. The ASP.NET MV C page has nice tutorials, but most are simple tutorials. We need a Cookbook of sorts I think ;)

I think all this will come with time - especially after the final release. however it is a bit frustrating to get going now (even with RC2) and have most of the stuff out there already outdated since it references Beta and Preview code :(

Brian
We definitely need more documentation. For now if i have an issue i search google and check out the asp.net mvc forums at forums.asp.net
Sruly
A: 

I think the fact that you have to run something to even see if it "Really" compiles is its biggest obstacle. All that "CODE" in your HTML markup can lead you easily down the path to the classic asp spaghetti code problem. Look for the compiler to improve in later versions.

+1  A: 
  • It seems like most tutorials have the validations set up in the controller, rather than the model, which I don't like
  • When you compile your code, it doesn't compile code that's in the views
  • The routes are a disgusting mess
  • I'd like to switch some of my projects over to not use code-behinds, but either they all have to have code-behinds, or none of them.
  • The testing still isn't matured (I think that will come with time, though)
Matt Grande
+1  A: 

It's worth nothing that ASP.MVC 1.0 is RTM as of today.

Richard Szalay