5 ms·
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
by icey 16y ago
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.
- bsk 16y agoIt 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.
- icey 16y agoI 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).
- brunomlopes 16y agoAs 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.
- bsk 16y agoHmmm, 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.
- brunomlopes 16y agoActually, 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.
- kennu 16y agoMS 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.
- lucisferre 16y agoThat 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.
- brunomlopes 16y agoJust 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 :)
- dan_b 16y agoYep, this is how I work, although I don't mind tapping out the ClassMaps myself as it's not much effort.
- brunomlopes 16y agoMeh, ClassMaps for 90% of the stuff are all the same, so I love the automap ideia mostly to spare me the bother :)