次の方法で共有


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

  • Anonymous
    October 11, 2010
    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

  • Anonymous
    October 11, 2010
    Great! When will be this functional published?

  • Anonymous
    October 11, 2010
    This looks great! When can we have it? :)

  • Anonymous
    October 11, 2010
    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.

  • Anonymous
    October 11, 2010
    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

  • Anonymous
    October 11, 2010
    Love the improvements!  Much needed on my project.  Will this be deployed in SP1?

  • Anonymous
    October 11, 2010
    Looks awesome, particularly like the multiple diagrams!

  • Anonymous
    October 12, 2010
    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.

  • Anonymous
    October 12, 2010
    +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?

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

  • Anonymous
    October 12, 2010
    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!

  • Anonymous
    October 12, 2010
    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) ?

  • Anonymous
    October 12, 2010
    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.

  • Anonymous
    October 12, 2010
    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

  • Anonymous
    October 12, 2010
    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

  • Anonymous
    October 13, 2010

  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.
  • Anonymous
    October 13, 2010
    Like the improvements too! Multiple Diagrams will be very useful feature. Great job!

  • Anonymous
    October 13, 2010
    @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/

  • Anonymous
    October 13, 2010
    Nice, real nice. Bring it on I guess.

  • Anonymous
    October 14, 2010
    The comment has been removed

  • Anonymous
    October 14, 2010
    The comment has been removed

  • Anonymous
    October 17, 2010
    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.

  • Anonymous
    October 17, 2010
    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

  • Anonymous
    October 18, 2010
    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.

  • Anonymous
    October 19, 2010
    @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.

  • Anonymous
    October 21, 2010
    Great news ! Almost all these improvements were features I've been missing ! Nice work

  • Anonymous
    October 23, 2010

  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.
  • Anonymous
    October 23, 2010
  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.
  • Anonymous
    November 01, 2010
    The comment has been removed

  • Anonymous
    November 01, 2010
    The comment has been removed

  • Anonymous
    November 01, 2010
    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

  • Anonymous
    November 06, 2010
    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).
  • Anonymous
    November 09, 2010
    Any idea when these improvements will become mainstream?

  • Anonymous
    November 09, 2010
    @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.

  • Anonymous
    November 27, 2010
    Great stuff! Wondering if you can continue to dodge =P  the question of a release schedule for these changes? my 0.02pecs worth

  • Anonymous
    November 28, 2010
    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)

  • Anonymous
    November 29, 2010
    zano04 - Multiple namespaces are not on the docket for the next release, they'll have to wait for a future one...

  • Anonymous
    December 04, 2010
    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.

  • Anonymous
    December 08, 2010
    .NET Links of the Week #40

  • Anonymous
    December 09, 2010
    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 - www.devart.com/entitydeveloper.

  • Anonymous
    February 03, 2011
    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 :).

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

  • Anonymous
    February 22, 2011
    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 :))

  • Anonymous
    March 06, 2011
    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!

  • Anonymous
    March 18, 2011
    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

  • Anonymous
    March 18, 2011
    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!

  • Anonymous
    March 23, 2011
    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.

  • Anonymous
    April 08, 2011
    Sarah McDevitt said "More soon!" - any idea when soon is?  It's been a couple of weeks and still no more posts from Microsoft

  • Anonymous
    April 17, 2011
    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.

  • Anonymous
    April 18, 2011
    Please provide a better way to automatically layout the diagram automatically.

  • Anonymous
    May 03, 2011
    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?

  • Anonymous
    May 04, 2011
    OMG!!!! SO NICE!!!!  This is SO BADLY NEEDED!!! Thx MSFT!

  • Anonymous
    May 29, 2011
    Soooo. what's the status about this.. Is this actually w.i.p.? Or are we waiting for nothing?

  • Anonymous
    June 07, 2011
    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

  • Anonymous
    June 21, 2011
    When will we see this. Another few weeks have passed...

  • Anonymous
    July 11, 2011
    blogs.msdn.com/.../announcing-the-microsoft-entity-framework-june-2011-ctp.aspx

  • Anonymous
    October 22, 2011
    Is there somewhere I can download and test these new features?  I need the multiple diagrams pretty badly.

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

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