Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

MVC3 + code-first from the EF4 CTP makes throwing together proof-of-concept apps very fast (and painless!). You don't have to do much besides design your models and you get a functioning site to start with.


It is fast, but I have a couple of problems:

1. A technical bug - EF often fails to update SQL Server DB on model change (RecreateDatabaseIfModelChanges).

2. More general - the generated UI is completely data centric, while even MS people advocate for business centric, task based UIs.


MS is still advocating task centric UIs? I've hated crap that since they started filling Win7 with vague, ambiguous buttons like "Setup a new network", "Connect to a network", "Connect to the Internet", "Connect to a workplace"... You have to click them to find out what they actually do.


That is a fair point, though I don't think the "task centric" approch can be held accountable for the issues with the design of the windows control panel. This is probably because control panels are not about "tasks" but settings and so it is a terrible paradigm for that.


I agree with you completely regarding model changes; I hope it gets fixed in the next CTP (or beta if they're close enough).

As to the generated UI, it's pretty similar to what you get with Rails scaffolding. I haven't spent a ton of time with it so you may know better than me, but it's nice having the default views generated while wiring everything together and then changing the generated views to build something a little more useful (the same way you'd do with scaffolded Rails objects).


As for point 2., I think you can generate the UI from any model class, right? So you can create a model for each task and generate the scaffolding for that particular model.


Hmmm, interesting idea. Lets say I have a 'change product price' task. ASP MVC will generate controllers/views for CRUD operations and a list. Those don't look very useful.


Actually, if your model has ProductID and NewPrice you can create just the Update controler/view for that. Put some validation on the model, and the scaffolding is done.

Or you could write the form itself with the "EditorFor" helper methods, either for the whole class or for each field. It's not perfect, but good enough for a quick prototype or first version.


Just to offer a different road, you could do something like that with the previous version of MVC + Fluent NHibernate with automapping and schema_update, if I'm not mistaken :)


Yep, this is how I work, although I don't mind tapping out the ClassMaps myself as it's not much effort.


Meh, ClassMaps for 90% of the stuff are all the same, so I love the automap ideia mostly to spare me the bother :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: