none
Using .NET Framework types in UML modeling project RRS feed

  • Question

  • When designing classes and sequence diagrams in a Visual Studio UML Modeling project, is there a way to specify .NET Framework types?  For example, I was designing a simple WPF email client as a way to learn the modeling features of Visual Studio 2010 Ultimate.  In my design, I wanted to use the System.Net.Mail.SmtpClient to do the actual sending of the email.  

    In my design, I have a model class with a private _smtpClient attribute that should be of type System.Net.Mail.SmtpClient from the System.dll assembly.  However, when trying to specify the type of the attribute, I'm only able to select built-in UML types, or custom types I've created in my modeling proejct.  When trying to just type the fully qualified name for the type, the SmtpClient class shows up as an unspecified type in the modeling project, which doesn't allow me to select operations in a sequence diagram.

    So, is there a way that I can reference a .NET framework type like this in a modeling project?  Thanks!

    Tuesday, August 16, 2011 2:18 PM

Answers

    1. Install VS 2010 Feature Pack 2, if you haven't already.
    2. Open Architecture Explorer (menu Architecture/Windows)
    3. In the first column, under File System, choose Select Files. In the dialog, navigate to and open System.dll
    4. Follow through the columns of AE, and find the SmtpClient type.
    5. Drag it onto a UML class diagram. The type will appear, with its operations. You'll also be able to see the type in UML Model Explorer, nested under packages representing System, Net, Mail.
    6. Open the sequence diagram, and drag the type onto the diagram to represent an instance of it.
    7. When you create a message to that instance, you should be able to see the operations of the type in the drop-down Operations property.

    - Alan -MSFT
    Friday, August 19, 2011 4:50 PM

All replies

    1. Install VS 2010 Feature Pack 2, if you haven't already.
    2. Open Architecture Explorer (menu Architecture/Windows)
    3. In the first column, under File System, choose Select Files. In the dialog, navigate to and open System.dll
    4. Follow through the columns of AE, and find the SmtpClient type.
    5. Drag it onto a UML class diagram. The type will appear, with its operations. You'll also be able to see the type in UML Model Explorer, nested under packages representing System, Net, Mail.
    6. Open the sequence diagram, and drag the type onto the diagram to represent an instance of it.
    7. When you create a message to that instance, you should be able to see the operations of the type in the drop-down Operations property.

    - Alan -MSFT
    Friday, August 19, 2011 4:50 PM
  • Hi Craig,

    Did Alan's reply answer your question? If it did, can you please mark this thread as answered? Thanks!


    Esther Fan | Visual Studio, Content Lead | If a post answers your question, please click "Mark As Answer" on that post and mark as Helpful. Thanks!
    Thursday, September 1, 2011 4:31 PM
  • Can you tell me how to accomplish the same thing in VS Enterprise 2015 (Update 1)?  VS 2015 does not appears to have an Architecture Explorer.
    Tuesday, May 3, 2016 5:10 PM
  • Hello.

    you are right, you cannot do it any longer in VS Enterprise 2015: we removed the reverse engineering as explained in the following blog post: https://blogs.msdn.microsoft.com/visualstudioalm/2014/10/24/upcoming-changes-in-visual-studio-architecture-and-design-tools/

    Do you use UML designers a lot? what are your scenarios?

    Regards
    Jean-Marc


    Jean-Marc

    Wednesday, May 4, 2016 9:39 PM
  • I'm not sure if my question was clear.  I am trying to reference types in the .Net framework.  Are you saying that this can no longer be done?  I understand that there is no longer an Architecture Explorer, I just want to use types from .Net in my model.
    Thursday, May 5, 2016 8:19 PM
  • Hello

    If you are using Visual Studio Enterprise 2015, the only option is to create this .NET framework type in your model.

    If you are using Visual Studio Ultimate 2010 to 2013 (that is before we removed reverse engineering of .NET types), you can reverse engineer .NET types to your model by doing a drag & drop from the Architecture Explorer, or the Class View (VS 2013)

    Regards


    Jean-Marc

    Tuesday, June 7, 2016 6:32 AM