.NET Answers

ASP.NET, HTML, CSS, Visual Studio, CSharp, VB.NET and other programming items of interest.
Subscribe
  • Home
  • About Me
  • Advertising
  • Click Here to Ask a question
    • Privacy Policy
  • Site Map

Advantages of Using Class Diagram

November 20, 2008 By: Dave

misc_vol4_063 One of the new tools that showed up in Visual Studio 2005 that I don’t see many people taking much advantage of is the Class Diagram.

The class diagram displays the classes you drag onto it in a visual representation much like a UML class diagram does.  It also lets you see relationships between your classes.  But the greatest power in the Class Diagram is that it will write a lot of your code for you.

The Class Diagram is available in both CSharp and VB.NET and works similarly in both.  My description of the tool will be using CSharp in Visual Studio 2008.  There may be a few quirky differences if you are using VB.NET and/or Visual Studio 2005.

I was reminded of this tool a couple of days ago when I needed to override a method but I couldn’t remember its name.  I could have spend a few minutes looking in the parent class for the name of the method I needed to override, but instead I created a new Class Diagram file and did a drag and drop of the class I was working on onto the Class Diagram’s surface.  This then let me right-click on the class and select “Intellisense” > “Override members…” from the context menu.

This will bring up a dialog that will list ALL of the classes the class inherits from (so it helps to know what class the method you want to override is in).  You can then check off the members you want to override from the list supplied.  When you press OK, the methods will be stubbed out for you in the source code.  All you need to do is provide the functionality.

You can use this same type of process to add new methods, add properties, and add member variables.

If you haven’t broken out the class diagram recently, I suggest you give it a try.

 

Other post in Did you know
  • Did you know - Zip is built into .NET? - August 21st, 2008
  • Panel DefaultButton does not work - September 23rd, 2008
  • Automatic Implementation of Interfaces - October 1st, 2008
  • Easily Find Classes, Methods, and Variables - November 17th, 2008
  • Advantages of Using Class Diagram - November 20th, 2008
  • Renaming Properties, Methods and Variables - November 25th, 2008
  • Finding a CSS Class Definition - December 3rd, 2008

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Related Post

  • How to code LINQ
  • Lambda Expressions. Other than LINQ…
  • Readable Code
Bookmark to:

Add to Del.icio.us Add to digg Add to DotNetKicks Add to DZone Add to Facebook Add to Slashdot Add to Stumble Upon Add to Technorati
Hide Sites
Tags: class diagram, csharp, vb.net, visual studio

3 Responses to “ Advantages of Using Class Diagram ”

  1. # 1 Dew Drop - November 20, 2008 | Alvin Ashcraft's Morning Dew Says:
    November 20th, 2008 at 10:10 am

    [...] Advantages of Using Class Diagram (Dave M. Bush) [...]

  2. # 2 Arjan`s World » LINKBLOG for November 22, 2008 Says:
    November 22nd, 2008 at 5:43 pm

    [...] Advantages of Using Class Diagram – Dave Bush ‘ If you haven’t broken out the class diagram recently, I suggest you give it a try ‘ [...]

  3. # 3 sangam uprety Says:
    November 29th, 2008 at 2:15 am

    Yeah, I agree. The use of class diagram can mean a lot. Mainly if we plan to develop business objects and design sort of layer architecture in .net applications. I have the experience that it takes so many time to manually code the class objects. Hope i would be inspired to go for class diagrams [I think I almost ignored it in my two years programming career]. THank you for the post.

← jQuery – class manipulation
Friday Books – ASP.NET 3.5 Unleashed →
  • Search

  • Subscribe

    U COMMENT
    I FOLLOW

    Subscribe in a reader

    OR

    Subscribe via e-mail

    Enter your email address: 

    Delivered by FeedBurner

     

  • Follow Me

    • Twitter
    • FaceBook
    • Digg
    • StumbleUpon
    • Propeller
    • Delicious
    • Plaxo

     

  • Recent Posts

    • ASUS Eee PC 1005HA-PU1X-BK Black Netbook
    • jQuery – Date Picker
    • Using VB.NET From CSharp
    • iTextSharp – Adding Images
    • Hungarian Notation – Use What Works, Spit Out The Bones
    • Pre Order Windows 7
    • jQuery Dialog – With Validation Controls
    • iTextSharp – The easy way
    • Structure of my ASP.NET Web Applications
    • 35% Off Accronis True Image 2009 Home
    • VB.NET Hide Module Name
    • ASP.NET/VB.NET – Video Training
    • Does jQuery Make Us Lazy?
    • PDFs Using iTextSharp
    • Programming SEO – Ping



  • Advertise on this site through Lake Quincy Media
  • DotNetNuke Sponsor

     

    Most Valuable Blogger
  • Sponsor

  • Categories

    • Advanced CSharp
    • Advanced VB.NET
    • ASP.NET MVC
    • Did you know
    • DotNetNuke – Module Development
    • DotNetNuke – Skinning
    • internationalization
    • iTextSharp
    • jQuery
    • none
    • Seach Engine Optimization
    • Silverlight
    • SQL For Programmers
    • Twitter
    • winforms
  • Cloud

    .net ajax architecture asp.net book books containers csharp css dal dataset datasets dotnetnuke events gridview images internationalization internet explorer javascript jQuery json linq listview modules ms-sql MVC objectdatasource programming reflection seo Silverlight skinning sql testing tsql tutorial Twitter twitterizer vb.net video view Vista visual studio webservice WordPress
  • Archives

    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
    • Privacy Policy
  • Calendar

    November 2008
    S M T W T F S
    « Oct   Dec »
     1
    2345678
    9101112131415
    16171819202122
    23242526272829
    30  
  • Blogroll

    • Alvin Ashcraft’s Morning Dew
    • ASP.NET Consulting
    • Life Hacker
    • Remember Anything
    • The Price of Their Toys
    • Uncategorized Thought


.NET Answers © 2007 - 2008 All Rights Reserved.
Entries and Comments.