Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

John Stallo - The Visual Studio 2005 Class Designer (2 of 3)

Download

Right click “Save as…”

I’ve personally been involved in several projects that started out with some great Visio diagrams for documentation that would eventually become stale as you progress in your coding.

In part 2 John demonstrates why those days are over because the class designer is really a living diagram that evolves with your code!  You can even launch refactoring straight from the class designer.

Enjoy!
- Josh

In other Devdiv happenings online... Gretchen interviews Pete Hauge, an SDET on the C# team, in a Blogcast about the Microsoft Puzzle Hunt, his job, and "after work" projects.

Tag:

Follow the Discussion

  • rasxrasx Emperor of String.Empty
    So we have Visio import mentioned here and I would expect some kind of export similar to the SVG stuff in HTML for Visio. But I am sure we can print these diagrams, which implies we can get them into PDF files. Great work overall! The good stuff about the Microsoft Access developer experience is really taking hold. It's back to the future and I welcome it.
  • Are the class diagrams different for C# and VB.Net? That seems to be what was implied, which would be strange to me.
  • Chris PietschmannCRPietschma​nn Chris Pietschmann

    This is pretty cool, but it reminds me a little of the SQL Query Designer; someone could easily write bad code (even though it may work, it'll have poor performance). I've seen people write SQL code with multiple levels of nested joins and sub-selects this way (most of whom can't write SQL by their self) which took minutes to run. I’ve had to rewrite a lot of SQL like this, and my queries would usually run in less than 2 seconds.  I guess any tool could be misused.

    I hope the Class Designer is much better. I'm looking forward to using this to improve my productivity.

    I'm really looking forward to all the enhancements coming in Whidbey!

  • R.RameshR.Ramesh RockOn
    Senkwe Chanda wrote:
    Are the class diagrams different for C# and VB.Net? That seems to be what was implied, which would be strange to me.


    Senkwe:  No, the class diagrams are the same.  But the terminology you see in the diagram will be customized to the language.  For example if you have a class diagram in a VB Project you will see terminology like "i As Integer"  whereas in C# you'll see "i : int".

    Ramesh.
  • R.RameshR.Ramesh RockOn
    CRPietschmann wrote:

    This is pretty cool, but it reminds me a little of the SQL Query Designer; someone could easily write bad code (even though it may work, it'll have poor performance). I've seen people write SQL code with multiple levels of nested joins and sub-selects this way (most of whom can't write SQL by their self) which took minutes to run. I’ve had to rewrite a lot of SQL like this, and my queries would usually run in less than 2 seconds.  I guess any tool could be misused.

    I hope the Class Designer is much better. I'm looking forward to using this to improve my productivity.

    I'm really looking forward to all the enhancements coming in Whidbey!



    Actually the Class Designer doesn't create any method bodies.  It just generates stubs - the developer will have to implement the logic.

    Ramesh.
  • CorvaxCorvax Corvax

    Where to we are going? Do we really have time to draw useless boxes or we better spend time doing real programming? Are you saying this spaghetti of boxes is more understandable than the source code?

    I think it is just a waste of time. Instead of playing with all of those boxes you better spend more time designing application!

  • sounds great!
    So what's the most fantastic feature of this tool compared with other ones like borland together?
  • TensorTensor Im in yr house upgrading yr family
    Dragging and dropping members - when you moved the name field & property to the person class - would you just get the stubs? Or if say I had written validation in my property, would that be copied too?

    Also, another refactoring question - not sure if this is the place for it! How flexible will the refactoring be? Changing public fields to private and giving them a property is great - is it possible to do custom refactoring which would add in, say a method call in the property set (say, a call to a method which sets a dirty flag)?

  • R.RameshR.Ramesh RockOn
    Tensor wrote:
    Dragging and dropping members - when you moved the name field & property to the person class - would you just get the stubs? Or if say I had written validation in my property, would that be copied too?

    Also, another refactoring question - not sure if this is the place for it! How flexible will the refactoring be? Changing public fields to private and giving them a property is great - is it possible to do custom refactoring which would add in, say a method call in the property set (say, a call to a method which sets a dirty flag)?



    Move members refactoring is not supported in V1.  You will be able to cut a member from one class shape and paste it into another.  This will bring along the method bodies (your custom code) as well.  Dragging and dropping members from one class to another is a natural way to move members in Class Diagrams.  Unfortunately, it is not supported in this release.

    With regard to the other question - you may want to check out the C# newsgroups at http://communities.microsoft.com/newsgroups/default.asp?icp=whidbey&slcid=us.  Here is the link to the c# Refactoring features in VS 2005: http://msdn.microsoft.com/vcsharp/2005/default.aspx?pull=/library/en-us/dnvs05/html/vs05_refac.asp."> http://msdn.microsoft.com/vcsharp/2005/default.aspx?pull=/library/en-us/dnvs05/html/vs05_refac.asp. The code snippets feature (http://msdn.microsoft.com/office/default.aspx?pull=/library/en-us/odc_vsto2005_ta/html/officeVSTOCodeSnippets.asp) is something you may want to check out as well.

    Ramesh. 
  • TensorTensor Im in yr house upgrading yr family

    Ramesh

    I'll check those out - thanks for replying to my queries!

    Josh or whoever posts them up - video part 3? Smiley

  • Nice presenation John!

    but seriously i think the point about whether this would actually make you a better programmer is valid.
    What isn't so valid a point is assuming that there is nothing to gain from the approach that is shown here.

    Synchronising your code pages with a .CD file has many advantages, some of them subtle ones. "Refactoring" is cool when it helps to standardise and accelerate understanding of the grammar (rules) of a programming language, but sucks when bloated, inelegant coding leads to 10 X the spaghetti to sift through.

    As other comments on this thread have pointed out giving coders the stubs of a subroutine/method does not a good member make.


    Tongue Out

  • ToddTodd

    Do we have any control over the generated code?
    For example, can I put my own things into the class designer toolbar? How? I haven't been able to find anything on how to do this.
    Those no-frill class and member stubs are not what I use. I use class templates and customized snippets for members in my projects, and I would need consistently generated code from the class designer, if I were to be able to use it.
    In case someone doesn't know what I'm talking about, when I do a new class, for example, my class template already has the regions in it I want, and my copyright notice and other meta comments at the top, etc., and when I do a new property with a code snippet, my property has a changed event. I have another snippets for lazy read-only properties, etc. I'd love to drag and drop one of my custom snippets onto a class in the class designer, or functionality that achieves the same result (directly via class designer - not a work around).
    Thanks.

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.