Search
Friday, December 14, 2018 ..:: Home ::.. Register  Login
   Calendar  
     
  
   Search  
     
  
   Blogroll  
     
  
   Disclosure  
All blog entries are the opinions of the author and do not necessarily reflect the opinions of their employer. All the code presented is for explanation and demonstration purposes only. Any damages incurred to your site and/or data are not the responsibility of the author. Every effort is taken to ensure the code properly compiles, however sometimes there are some hiccups and you might be required to do your own debugging.
     
  
   TechTidBits (Blog)  

Want to look at how your classes are designed at a high level? How hard can it be?

Oct 9

Written by:
Tuesday, October 09, 2018 4:18 PM  RssIcon

imageAre you using Visual Studio 2017 Enterprise? Did you know you have access to a too called Class Designer? It’s simply awesome! It will qucikly give you a a birds eye view of your classes and their inheritance structure. It’s awesome!

However, if you’re using Visual Studio Professional, you will have a hard time finding it. How come? Well, “technically” you DO have it, you just need to work a bit hard for it. Specifically you will need to go back to your Visual Studio application in Programs and Features in Control Panel and install it.

Here’s the Coles Notes version (hey, if you’re reading this, chances are you know what to do now LOL).

InstallingClassDesigner

To use Class Designer, just know that (by default) you will be adding a new ClassDiagram1.cd file to your project (so it’s not completely free, but the cost is negligible). Right click on your class file of interest, then select the View Class Diagram option.

image

After that you’ll see one class on a canvas. Right click it and select Expand (or use the NUM + key). You’ll see the methods and properties show up. Next right click and select Show Derived Classes. Again, select Num + or right click and Expand to see more details. Continue until you’re happy with understanding the class hierarchy. Next, notice up top, it will say ClassDiagram1.cd* (notice the asterisks). That’ cause the file hasn’t been saved yet, you could save it for future reference if you wanted, or just blow it away and recreate later if need\want.

For the sample project I whipped up to illustrate what you would see, here’s what the class diagram looks like, and more importantly, what types of information you can glean from it. What is also really cool about the class diagram is, you can double click in it and navigate to that class’s code, it’s another way to navigate your code (in addition to the Solution Explorer).

image

There you have it, a quick way to get a high level understanding of your class structure\hierarchy. Now that you know how, it’s not that hard.

Tags:
Categories:
Location: Blogs Parent Separator TechTidBits

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 
     
  
Copyright 1999-2012 by PCHenry.com   Terms Of Use  Privacy Statement