Chapter 25. Domain-Centric Modeling

Visual Studio 2010 brought new approaches to modeling for Entity Framework. The Sample and BreakAway models you have created and worked with thus far were reverse-engineered from existing databases. We call this type of modeling database first.

While basing an application on an existing corporate database is often necessary, many developers are able to design the database behind their model, completely from scratch. Other developers, such as those who follow Domain-Driven Development (DDD) patterns, prefer not to begin with the database, but rather with a conceptual model of their domain or simply with their own domain classes.

Beginning with Visual Studio 2010, the Entity Data Model Designer supports both of these development styles in addition to database first.

You can begin by describing your application domain as an Entity Data Model and then use that model to define a database. This is referred to as model first.

Alternatively, you can eliminate the EDMX model completely and focus on describing your application domain through your classes. This feature is called code first and is a future feature that Microsoft is currently building for the Entity Framework.

While this is the only chapter in which I discuss these other approaches, I do not mean to imply that they are less significant than database-first design. They are, in fact, very significant and if you are used to beginning with a database, you may find enlightenment as you explore these ...

Get Programming Entity Framework, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.