次の方法で共有


Class Designer: What's new in Visual Studio 2005 Beta 2?

There are some really cool features coming online in Class Designer Beta 2 - automatic layout of the diagram, ability to export diagram as an image, display collection associations, display member types, ability to auto adjust the width of the shapes, etc.

I will go over the auto layout feature in this post.

When I create a diagram to visualize an existing code base (source code or assembly), I expect to quickly create a default diagram of all the types. Then I usually go over the high level class structure of the project. Then I will go ahead and start removing the types that I am not interested in and drill into the details of the rest. In order to do this efficiently, I would like to have the shapes in the auto created diagram organized in some manner that I can understand.

In Beta 2, selecting the “View Class Diagram” context menu on a project node in the solution explorer or a namespace node in class view will create a class diagram with shapes for all the types in the project/namespace. Types participating in inheritance relationships will be placed on the left hand side and types not participating in an inheritance relationship will be grouped according to the type (classes, interfaces, enums etc.) and placed on the right hand side. This provides me with a quick understanding of the inheritance hierarchy of the classes in the project. If I want to remove all the types not participating in inheritance, it is very easy for me to select them and remove them from the diagram. The layout algorithm is smart about the white spaces in the diagram and tries to utilize them as much as possible.

The shapes are initially collapsed. I can then go and expand the types I am interested in, look at the member details. Now, this may screw up my layout. But not to worry. There will also be a "Layout Diagram" command available to layout the diagram which can be invoked on the entire diagram or on a selection. I can use that command to re-auto layout the diagram.

Here is a link to a couple of diagrams (System.Xml and System.IO namespaces) auto laidout by the tool (this is before doing any manual editing).

Of course, auto layout will not be able to solve all your layout issues. We have to pick and choose between providing an optimal layout versus performance and other issues. It is intended to give you a running start. You will probably end up manually placing the shapes and rerouting the lines when you are ready to publish the diagram. Yes, you can publish your diagram as images - more on that soon.

Cheers,

Ramesh.

Comments

  • Anonymous
    January 18, 2005
    Very cool! I'm really looking forward to using this. Something that sticks out though is that the autolayout doesn't appear to adjust the width of shapes so you often end up with elipses. That will usually mean that the image is no longer something I can just print to hang on a wall or paste into a spec. I'll have to manually adjust the widths which leads to repositioning other nearby shapes.

  • Anonymous
    January 19, 2005
    <P>This sounds great. However,&nbsp;I looked at the sample diagrams in your post and it became very clear to me that some navigational aid is needed.&nbsp; So my question would be: Are we going to see a Pan &amp; Zoom Tool Window like this one (from Visio 2003) in Visual Studio 2005 Beta 2?</P>
    <P><IMG src="http://storage.msn.com/x1p_TyFkcHJmrUjAHxyIgvGgRGQYv-u0d-ZhsOLsy8gj9gi9OhKG9GMhKehMAjTbqPTtWkETLaqIcMF0ZSVsAWeasivHpnbyDvSxYh9qxQpFkEC7385p24V-Q"></P>
    <P>Thank you and the rest of the Developer Division for all the great improvements in Visual Studio 2005,</P>
    <P>Marco</P><A href="http://spaces.msn.com/members/vs-uxhttp://spaces.msn.com/members/vs-uxhttp://spaces.msn.com/members/vs-ux"><U><FONT color=#800080></A></FONT></U>

  • Anonymous
    January 19, 2005
    The comment has been removed

  • Anonymous
    January 23, 2005
    Blog link of the week 03

  • Anonymous
    May 31, 2008
    There are some really cool features coming online in Class Designer Beta 2 - automatic layout of the diagram, ability to export diagram as an image, display collection associations, display member types, ability to auto adjust the width of the shapes

  • Anonymous
    June 13, 2009
    PingBack from http://thestoragebench.info/story.php?id=663