Create your schema with Entity Framework

In case you haven't yet, it's worth reading about what's new with Entity Framework in Visual Studio 2010 RC.

Of the two items highlighted for the framework, the one that excites me the most is the DDL generation capability. I find that it comes in very handy in two different scenarios:

  • At deployment time, it makes it easier to deploy an application as a simple executable. No database to setup separately or script files that I have to bundle (or embed as resource), then access and act upon at runtime. Very clean, very easy to develop.

  • At development time, instead of having to update a database and a database script and work on the mappings, I can simply work on my model and make sure I always get the latest version. There are less artifacts to keep around and in sync, which again is less of a hassle for me.

Of course this isn't the ultimate schema handling tools - migrations, index tuning, runtime DDL updates like using work tables or building archive tables and such, all these things still need something more fine grained. But the basic scenario to get you up and running quickly works great, and if you don't need the additional sophistication, you're probably close to done.


Comments (2)

  1. BuckWoody says:

    Yikes! Working directly to a physical model = disaster

  2. @Buck

    Well, you can always change the underlying physical model along with the mapping – that’s where some of the EF beauty comes in.

    I guess I should have added a caveat that this is great *for some cases*, and perhaps added a bit more on which are in and which are out. Good fodder for another post.

    Would you care to contribute any war stories of particularly bad cases where coupling to physical models led to disaster? I find real life examples make the issues so much crisper.

Skip to main content