View the object model

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akshaycjoshi
    New Member
    • Jan 2007
    • 153

    #1

    View the object model

    Hi,
    I have seen in books representing the class hierarchy using diagrams as in VS class disigner.
    I want to know how can i view the class hierarchy (uml diagrams) using VS 2005.
    That's for learning purposes.
    for example see THIS link.

    For example I want to know the entire hierarchy od the class DataSet, how would i do that ?
  • mldisibio
    Recognized Expert New Member
    • Sep 2008
    • 191

    #2
    In Visual Studio:
    Navigate to the Class View Window.
    Open the node for your project or solution.
    If you want to see Framework classes, then open the Project References node.
    Right click on either a class or a namespace and choose "View Class Diagram"

    Note: Child classes do not automatically pull their parent hierachy into the diagram. To get a complete picture, you may need to diagram an entire namespace. This can take up serious machine resources for large namespaces, and also brings in more detail then you may want. Or you can simply manually add the parent classes to the diagram by following the Framework documentation.

    Comment

    • vekipeki
      Recognized Expert New Member
      • Nov 2007
      • 229

      #3
      It's called Class diagram, you can add it to your project in the same way you're adding any other new item, right click in Solution explorer, Add new item.

      Comment

      • akshaycjoshi
        New Member
        • Jan 2007
        • 153

        #4
        Thnaks i can see the classs diagram now :)
        But the problem is that when i view the class diagram of an entire assembly, it shows only the classes and not the relation between them.

        Se the link i gave in my first post.
        I want it that way(it's not the backstreet boys song).

        Comment

        • mldisibio
          Recognized Expert New Member
          • Sep 2008
          • 191

          #5
          You can right-click on a class and choose "Show Base Classes" or "Show Derived Classes."

          The VS Class Diagram will not show composite relationships ("has-a"). It will show implementation relationships ("is-a"). The sample diagram you point to may have had the relationships drawn in afterwards, or may be generated from a different tool.

          Are you diagramming a Framework assembly? If so,which one? You would be surprised how shallow many Framwork classes are. Many only implement interfaces and do not have deep class hierarchies.

          Plop the ToolStripItem, ToolStripDropDo wnItem and ToolStripMenuIt em classes from the System.Windows. Forms assembly onto the Class Diagram surface and see if the relationships show up.

          Comment

          Working...