Entity Designer Improvements Preview


The team has been quietly working on a number of improvements to the entity designer that we would like to show off and get feedback on. This particular set of features is targeted at making modeling more productive and scalable, and models themselves more comprehensible.


We’ll start with the small, fun things, and build up to a grand finale.


1. Association Highlighting

Let’s start with this. Consider the following model:

 

We would like to rename the navigation properties to something meaningful, as well as the foreign keys. But which navigation property is related to which foreign key? And to which association connector?


So, now you can select an association or navigation property and find out. Here, we select the “Address.Person” navigation property, and the designer highlights the two entity types involved in the association, the association connector, the navigation property on the other side, as well as the foreign keys that hold the navigation information.

 

 

 

This makes it easier for us to rename things to:

 

2. Property Reordering

 

Imagine that you want to add a “Name” property to the “Property” type above. You do this and end up with a type that looks like this:

 

 

 But of course, you want this new property to be the second one in the type, below “Id”. Well, now you can select this property and, for example, press Alt + Home, which will move that property to the top of the type, then on Alt + Down Arrow to move it down one slot. Here is a screenshot of the type, along with the new “Move Properties” menu:


You can now select multiple properties at the same time and move them.  For example:


3. Entity Shape Coloring

 Imagine, now, that our model has gotten more complex, and viewing it all in one window renders areas of the diagram hard to distinguish:

 

 

Entity shape coloring allows us to visually divide a single diagram into multiple meaningful areas by color coding them. You can select one or more entities and in their property sheet, change their color, which lets us do something like this:


4. Multiple Diagrams!

But what if you just want to look at subject areas within a diagram? Say, the product catalog entities, or the sales types. In that case, you can select any number of entities and move them into a new diagram by right-clicking and selecting the new “Move to new Diagram” menu item. If we do this to our “Property” type, we’ll see it appear in a new diagram. And, if we make the model browser tool window visible, we’ll see this:

 

 

Note that we now have a new “Diagrams” folder in the model browser, and that the new diagram opens in its own tab, allowing you to have multiple windows open at once against the same model. This diagram is a little sparse. Let’s bring into it any types related to “Property” by right-clicking it and selecting “Include Related”:

Now, color the “Person” type green, then bring its related type, and see how they pick up the original type’s color:

 

(Note that this models is not a real-world one and only intended for visualization purposes.)

 

Some additional notes:

          You can also drag and drop associations, types, and entity sets from the model browser.

          You can cut or copy and paste objects from one diagram to another.

          Deleting objects from a diagram will no longer delete them from the model, but only from the diagram.

          You can delete objects from the model by using Shift+Del, right clicking and selecting “Delete from Model”, or deleting them from the model browser.

          Diagrams are stored in a child file of the edmx for new edmx files. For backwards compatibility, models created in previous versions of visual studio will keep the diagram information in the EDMX file itself. However, you can move the diagram information from the EDMX to a child file by right clicking and selecting the “Move Diagrams to Separate File” context menu.

 

We look forward to your feedback!

  Noam

 

 

Comments (59)

  1. Simon Francesco says:

    Hi Noam,

    Looks good, particularly the highlighting of each association when dealing with multiple associations between related entities, I had to do this manually not 20 mins ago :)

    Also the copy and paste between diagrams would be very useful especially since I tend to keep one edmx per functionally area and so often need to recreate overlapping areas  eg the overlap between Accounts Receivable and Accounts Payable edmxs. Entity shape colouring goes some way in this area as well.

    Another time consuming designer task is renaming from Db field names to Object Property names. It would be great if when you create a new edmx with overlapping tables that you could 'scavenge' mapping names from other edmx files in the solution. eg how many times I might have to rename blnAct to IsActive etc.

    It would great if the existing mappings where treated as a reusable asset in this respect, may be exportable and importable in some key value format??

    BTW Are there improvements on the way to composite key handling (primary and foreign), or FKs that reference unique keys rather than the primary key?

    One last thought: Another major time consumer is the round tripping in the model first/db first journey. Currently if I make any non trivial changes to the model I have to create a new blank database from the 'Generate Database from Model' tool  then use a third party tool to diff the existing and new dbs or just figure our the changes manually. A more comprehensive path to update the model and produce a db change script would be a huge step forward.

    Finally is there any way to enjoy any of these new features out-of-band ie: before the next VS version, if so how?

    Cheers

    Simon

  2. nova5 says:

    Great! When will be this functional published?

  3. JasonBSteele says:

    This looks great! When can we have it? :)

  4. Gary says:

    Simon, a lot of the time consuming problems you mention have already been solved by other O/RM designers. LLBLGen Pro (http://www.llblgen.com) for instance, even lets you generate code for EF.

  5. http://msmvps.com/blogs/matthieu says:

    It's great Noam and we already spoke many times about the importance of the designer (for my customers particularly). However, what about complex types on the designer, what about Horizontal Entity Splitting, what about TPC?

    Matthieu

  6. RHood says:

    Love the improvements!  Much needed on my project.  Will this be deployed in SP1?

  7. CodingGorilla says:

    Looks awesome, particularly like the multiple diagrams!

  8. James Hancock says:

    Please please please please ProviderManifestTolken in the designer so that we can SET it. It's a real PITA right now to develop for SQL Server 2005 when we have SQL Server 2008 DBs here.

  9. Mohamed Meligy says:

    +1 for ProviderManifestTolken. Hit me many times before.

    The idea of multiple diagrams in theory should solve performance issues. Let's hope so…

    When can we get these bits to play with?

  10. Simon Francesco says:

    @Gary, thanks looks interesting and very comprehensive. I guess I am just hoping to get some of the core offerings from MS improved :)

  11. Noam says:

    Thanks for the feedback! Yes, we are working on the unique key handling feature, and are looking at a few different ways of make the model-first feature migrate, rather than recreate, your database.

    I'll work with the team to see if we can push ProviderManifestToken handling into the next release!

  12. sip says:

    It must be possible to highlight properties based on some condition. For example, I want to highlight nullable ones in gray, keys in orange, and numeric in fuchsia.

    Also move for properties is ok, but what about sort (alphabetically, or by types, or some other way) ?

  13. Simon Francesco says:

    One other thing that I seem to spend a bit of time doing but have to leave the designer to do is to manually add the DefaultValue attribute to the various not nullable storage entities that are not mapped to conceptual entities. It would be great if the model generator could read this info from the db and automatically apply these attributes to the storage and/or conceptual models.

  14. JasonBsteele says:

    The biggest problem we currently have is with the difficulty of merging changes for an EDMX from two or more developers. Will the multi-diagrams alleviate this? I.e. Is each diagram a separate part of the overall EDMX – or are they just the designer elements?

    Thanks, Jason

  15. JasonBSteele says:

    The biggest problem we currently have is with the difficulty of merging changes for an EDMX from two or more developers. Will the multi-diagrams alleviate this? I.e. Is each diagram a separate part of the overall EDMX – or are they just the designer elements?

    Thanks, Jason

  16. Noam says:

    1. We could not get these improvements shipped in SP1. We'll ship them as soon as we can after that release.

    2. The diagrams can be stored in a separate file from the EDMX, which should alleviate some source merging issues: For backwards compatibility, existing EDMX files will keep the diagrams in the EDMX file, so you can open them in older versions of VS. New EDMX files will store the diagrams in a separate file. For existing EDMX files, there is a right-click context menu item called "Move Diagrams to Separate Files" that you can use if you do not need/want backwards compat.

  17. Sergey Perepechin says:

    Like the improvements too! Multiple Diagrams will be very useful feature. Great job!

  18. KristoferA says:

    @Noam, looks great!

    @Simon, if you want to add incremental SQL-DDL generation to avoid having to regenerate the db, take a look at my 'model comparer' feature for EFv4. It is part of my add-in Huagati DBML/EDMX Tools for VS2010, and gives you more granular control over DB <=> SSDL <=> CSDL differences and allow you to bring individual changes across without touching unrelated areas of the model.

    I have posted a couple of screencasts showing what it can do here:

    huagati.blogspot.com/…/introducing-model-comparer-for-entity.html

    huagati.blogspot.com/…/using-model-comparer-to-generate.html

    …and if you want to take it for a test-spin you can download the add-in and get a trial license at http://huagati.com/dbmltools/

  19. GeoffHirst says:

    Nice, real nice. Bring it on I guess.

  20. Zeeshan Hirani says:

    awesome work. cant wait to get my hands on the new features and new designer.

  21. danieldsmith says:

    OMG, I'm absolutely gurgling with glee with these designer improvements!  In particular, multiple diagrams are going to be an absolute god send.  It's a total nightmare at the moment when we have multiple devs trying to edit the same diagrams.

    Will we be able to include the same entity in multiple diagrams though?  From the "move to new diagram" option, it sounds like an entity can only exist in one diagram at a time.  Quite often I have entities that relate to lots of other enties in different ways, and it would be great to be able to include them in each sub-diagram.  Of course, if you make changes to an entity in one diagram, it would have to also keep any other instances in sync too.

    Hopefully we won't have to wait too long for these enhancements.  The EF really needs to maintain a fast pace – being tied in with the mololithic Visual Studio releases is too slow.

  22. Mark Harby says:

    I second the request for the designer to read defaults from the database schema for non-nullable fields, this is a tedious and time-consuming job to do each time we create a model. Would be really good to include niladic function defaults here as well, especially getdate() and suser_sname(), we use these extensively in our databases for logging etc.

    Also, same question as Daniel Smith, will we be able to include the same entity in more than one diagram (like we can with SQL Server database diagrams) ? This will make it an awful lot easier to work on larger models with multiple developers.

  23. Klaus Even Enevoldsen says:

    Great new features! When can we have it as a CTP or a Power Pack or something or anything?!? :-) It seems really complete…

    Have you seen this site for customer feedback on Entity Framework? data.uservoice.com/…/72025-ado-net-entity-framework-ef-feature-suggestions

  24. Hugh Proctor says:

    This looks great… though I probably will maintain my current method of splitting my database tables into groups and therefore edmx models. This gives strength for improved security model and pluggable data providers; so I can develop one area of the systems data model with no effect to others, I can then sell this as a plug add on.

    This gives rise to JasonBSteele's similar problem of version and change control on edmx models.

    Another important step would be 'using' … one edmx could import and use the objects of another that is imported, making them readonly.

  25. Simon Francesco says:

    @Kristofer  ขอบคุณครับ that looks very impressive. Great to see designer features that deal with SSDL and the SQL diff script look like just what I was looking for. Will definitely give it a try.

  26. KG says:

    Great news !

    Almost all these improvements were features I've been missing !

    Nice work

  27. phil harris says:

    1. second the shared entity across multiple diagrams

    2. What about basic documentation and annotation for the diagrams ? ala SQL Diagrams – Ability to document and annotate the models with text, labels, boxes etc that help describe the intent of the model right on the design surface.

  28. phil harris says:

    1. second the shared entity across multiple diagrams

    2. What about basic documentation and annotation for the diagrams ? ala SQL Diagrams – Ability to document and annotate the models with text, labels, boxes etc that help describe the intent of the model right on the design surface.

  29. Kendall Morley says:

    One very useful feature would be scripting or macros in the designer so I can script exverything I do to a model and then blow away the model, recreate it from an updated db and then rerun my scripted changes.

  30. Kendall Morley says:

    It would be nice to be able to specify extended properties on a table/column/….  in the designer.

    It would be nice to be able to delete something from the model and then re-add it without having to worry about messing up the mapping and storage parts of the edmx and being forced to hack it.

    It would be nice to be able to set a primary key guid column to identity without having to hack the edmx.

    It would be nice to be able to specify default values for columns right in the Designer

    it would be nice to import the nullability straight from  the database.

    Some kind of working sych tool so I can synch an editted model with and editted db and pick and choose how the sych happens and then have everything work without having to redo all my changes, or hack the edmx file.

    Some kind of edmx merger to allow multiple developers to editit the model and then merge the changes without having to parse the edmx file and merge it in their heads.

    It seems like you guys are working on fluff rather than some of the basics.

  31. hdesouky says:

    I liked this new feature very much.

    I would like to vote for another feature, using the database table schema as part of generated class namespace. (I don't know if this doable in the t4 templates)

    when this new designer enhancement will be available (weeks or months)?

    Thanks

  32. rjfhendriks says:

    Looks good, nice work! My little wish list:

    – extending properties and the availability of these extensions in T4

    – more business rules in the model (data annotations, inter entity rules and inter record rules)

    – a solution for having a framework with edmx and a project with edmx so framework model and data code can be resused between projects within 1 context (f.e. merging context or using an edmx in another edmx).

  33. fldevs says:

    Any idea when these improvements will become mainstream?

  34. KristoferA says:

    @Kendall Morley,

    Many of the features you're asking for are available in the Model Comparer for EFv4 that is part of this Visual Studio add-in: http://huagati.com/dbmltools/

    It allows you to bring selective changes across, it uses documentation from extended properties, it allows you to set up rules as for what db-side default constraints should be treated as identity/computed, it syncs nullability/storegenerated/default value between CSDL and SSDL, and it allows you to select exactly what changes you want to bring across between the layers _without_ touching any unchanged portions of the model. Download it and try it out and I think you will find that it complements the EFv4 designer in VS2010 with a lot of the things you're asking for.

  35. amorano says:

    Great stuff!

    Wondering if you can continue to dodge =P  the question of a release schedule for these changes?

    my 0.02pecs worth

  36. zano04 says:

    Multiple diagrams are great.

    Will there be support for multiple namespaces?

    (With the possibility to associate 2 entities from different namespaces, this could simplify big models)

  37. Noam says:

    zano04 – Multiple namespaces are not on the docket for the next release, they'll have to wait for a future one…

  38. Jenda says:

    One thing I'd really need at the moment is the ability to populate the list of options presented to the user for custom properties added via a Visual Studio extension and a EntityDesignerExtendedProperty. The enums are nice for things that are static, but annoyingly restrictive. For example if you need the developer to be able to specify an entity as the value of the custom property, all you can do is to make the property a string and add a validation into its setter. No way to give him a list.

    I'd also like to add a property that'd let me specify what permissions must a user have to be able to edit something (I'll script it out as an attribute then and use it in a custom model binder and in html helpers), but again, how do I give the developers the list of permissions? In this case as the VS extension is in-house and so far used only for one project, I can copy the enum definition into the extension's sources, but that's rather … suboptimal.

  39. Devart says:

    Most of these features have been implemented in the Devart Entity Developer. It is a powerful modeling tool that allows to build models for LINQ to SQL and Entity Framework. Some of Entity Developer features are presented below:

    * You can use Model-First and Database-First approaches

    * You can highlight associations

    * You can drag-n-drop properties inside entity.

    Read more about Entity Developer features on our web-site – http://www.devart.com/entitydeveloper.

  40. Simon Francesco says:

    4 months on…..any update on a release of these features even in a CTP? Would love to see more out-of-band releases of this nature rather than ~2 yearly versions :).

  41. Chris says:

    Any news?  Makes you wonder how committed Microsoft are to Entity Framework; even the EF design blog only has two entries since this one!

  42. Martin says:

    Hi,

    is there any news on when to expect a release??

    Coloring and multiple diagrams are desperately needed !!

    Great work… judging by your screen-shots :))

  43. Chris says:

    A month on from Simon asking and almost a month from me asking… I guess no one at Microsoft is reading this any more.  Either that or they are no longer interested in EF!

  44. Sarah says:

    Hi all —

    Thanks for all your suggestions and excitement over the features Noam had laid out here. We had a transition of work, apologies for the lack of responses on the blog during that.

    We are very interested in EF and are working on even new features for EF and the Entity Designer to get out to you along with these ones. We are also working on faster releases to get these features to you all as soon as possible without you having to wait the long times between major product releases.

    More soon!

    Sarah McDevitt

  45. Fhallot says:

    This is indeed

    a long time ago that it was announced and we still have no ideas about when we will be able to use these interesting improvements!

  46. David Weir says:

    I got really excited about this, but 6 months on, and still no sniff of a release date. Any surprise people find alternatives such as devart, LLGenPro, nHibernate, DevForce.

    The serious shortfalls of edmx (that have seemingly been overcome) at least warrant a CTP, PowerPack or Plugin. I wish I had customers whom I could show them a pretty picture of how something might look, then sit on it for 6 months without a peep.

    I can only assume (like all others on this thread) that EF just isn’t a priority.

  47. Chris says:

    Sarah McDevitt said "More soon!" – any idea when soon is?  It's been a couple of weeks and still no more posts from Microsoft

  48. Frank says:

    We are really waiting for it, NOT more diagrams was the last obstacle for us.

    Hello Microsoft developers,

    can you give a date when this is available for us?

    Thank you.

  49. Peter Svahn says:

    Please provide a better way to automatically layout the diagram automatically.

  50. Chris says:

    Almost a month since I asked Sarah when "soon" is and no reply from her so I guess we can just assume that no news = we don't care so go away and find something else to use?

  51. Ivan Perez says:

    OMG!!!! SO NICE!!!!  This is SO BADLY NEEDED!!! Thx MSFT!

  52. Expecho says:

    Soooo. what's the status about this.. Is this actually w.i.p.? Or are we waiting for nothing?

  53. Dadv says:

    I've just install the SP1 hoping this feature will be inside (posted 9 months ago !) but nothing new in the SP1…

    Please give us just a date or a release number where this feature will be include.

    Thank's

  54. Jan says:

    When will we see this. Another few weeks have passed…

  55. Shaun says:

    Is there somewhere I can download and test these new features?  I need the multiple diagrams pretty badly.

  56. Jeff says:

    @Shaun, click the link in the comment previous to yours (for the June 2011 CTP).

  57. jem park says:

    Architects today use such program on deciding which interior ( http://www.az-homes4u.com/ ) compliments the whole design of the house.