I have been trying to get my hands dirty with ASP.NET MVC which looks pretty good (I am not certain, but some users say that even StackOverflow and other StackExchange websites made use of it). The tutorial I am following is from asp.net, named MVC Music Store. It's a pretty fast paced tutorial and a good one too. The question that bother's me while going through the various tutorials available on this site including the MVC Music Store is the automated code used for developing them.
Like, this tutorial makes use of Entity Framework 4, which supports a development paradigm called code-first. You add an Entity class inheriting from Entity Framework database context , add two lines of code and it will handle our create, read, update, and delete operations for us.
public class MusicStoreEntities : DbContext
{
public DbSet<Album> Albums { get; set; }
public DbSet<Genre> Genres { get; set; }
}
Similarly, when I used the Scaffolding feature while adding a controller, like following :
It does a hell amount of work on its own :
- It creates the new StoreManagerController with a local Entity Framework variable
- It adds a StoreManager folder to the project’s Views folder
- It adds Create.cshtml, Delete.cshtml, Details.cshtml, Edit.cshtml, and Index.cshtml view, strongly typed to the Album class.
As you can see, the developer's life made a hell lot easier with this automation but the question remains is whether or not this automatic code is good enough for production development ? Does anybody use(Does SO) use them. Is there any downside associated with these codes or one should be encouraged to use them ?