Large Models

Retrieving Metadata

When using database-first approach, the first stage of creating model entities is retrieving metadata of database tables. If you have a large database, this stage can take a lot of time. For example, when dragging AdventureWorks database tables from the Server Explorer to Object Relational Designer in Visual Studio 2010, it can take more than 30 seconds to build the model.

Entity Developer have highly optimized metadata retrieving. All database tables are retrieved with their column metadata, reducing the number of server calls and metadata retrieving duration. In the same example with AdventureWorks database, it took less than 3 seconds to get metadata and several seconds more to display the model with Entity Developer.

Using Multiple Diagrams per Model

In case of large models containing many entities, the diagram may become too complex to understand and edit. To make your model better understandable, you may split it into several thematic diagrams, each one having a part of model entities. For example, all entities, related to sales may be on one diagram, and production entities - to another diagram.

Managing diagrams is very easy. Model diagrams are displayed in the Diagrams node of the conceptual model in the Model Explorer. Here you can add a new diagram to your model, remove or rename existing model diagrams at any time.

Model can have as many diagrams as you need, and each diagram may contain any model entities. When creating a new diagram, you may immediately choose model entities to display on it. To add an entity to a diagram, just drag it from the Model Explorer to the diagram. When deleting an entity from a diagram, you will be asked whether to delete it from a model, or just from the diagram. All model changes, for example, deleting entities, properties or associations, affect all the model diagrams immediately.

Each Model has at least one diagram - default diagram. This diagram is displayed when the model is opened. If you delete this diagram, another diagram is marked as default. You cannot delete the last model diagram. You may mark any diagram as default from the diagram shortcut menu.

If you generate a model from a database, you can split model into diagrams by schemas or create only one default diagram with all or part of the entities.

Code Generation

Standard Entity Data Model Designer and LINQ to SQL Object Relational Designer generate all the code for entities into one file. On a large model, this file can become too large, and it can slow down or hang up Visual Studio when working with such file.

Entity Developer can automatically generate a separate code file for each entity. All you need is to select the corresponding check box in model settings. It is much more comfortable to work with separate files for entities than with one huge file.

Entity Framework View Pregeneration

Before the Entity Framework can execute a query against a conceptual model or save changes to the data source, it must generate a set of local query views to access the database. It is a time-consuming operation, especially for large models. To increase the speed of the first query execution, Entity Framework allows pregenerating views at design-time. The process of pregenerating views is described here.

However this process is a bit complex in a Visual Studio Entity Data Model Designer. Entity Developer provides much easier view pregeneration. You need just to select the corresponding check box in model settings to include pregenerated views to your application.