Posted By: The Channel 9 Team | Apr 1st, 2005 @ 10:31 AM | 51,592 Views | 11 Comments
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.
Media Downloads:
Rating:
0
0
rasx
rasx
Programmer/Analyst III, 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.
CRPietschmann
CRPietschmann
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.Ramesh
R.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.Ramesh
R.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.
Corvax
Corvax
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?
Tensor
Tensor
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.Ramesh
R.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. 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. 
Microsoft Communities