Visual Studio Developer Center > Visual Studio Forums > Visual Studio Class Designer > Can you model Aggregations in Class Designer?
Ask a questionAsk a question
 

AnswerCan you model Aggregations in Class Designer?

  • Sunday, May 21, 2006 6:48 PMImesh Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi All,

    Can you model Aggregations in Class Designer? I couldnt find the aggregation element in Class Designer ToolBox.

    Imesh.

Answers

  • Monday, May 22, 2006 10:22 PMSampy MSFTModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Class designer doesn't support this visualization in the current version.

    We'll keep this in mind for a future release.

All Replies

  • Monday, May 22, 2006 10:22 PMSampy MSFTModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Class designer doesn't support this visualization in the current version.

    We'll keep this in mind for a future release.

  • Tuesday, May 23, 2006 3:30 AMImesh Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I found in Class Designer Web Log that we can use the List Class to Collection Associations. I think it can be used to represent aggregation relationships. What do you think?

    Imesh
  • Monday, June 12, 2006 7:07 PMLOTONtech Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    The problem is that Aggregations and Compositions cannot be distinguished from regular associations in code because the .NET languages (apart from Visual C++ perhaps) do not distinguish members held "by reference" (regular association) from those held "by value" (aggregation or composition).

    Even if you could model aggregation in Class Designer, the information would be lost when you re-visualized the code, for example by dragging the classes onto another class diagram.

    This is where the VS2005 Class Designer differs from UML class designers. The VS2005 is a 100% visualization of the code, with no translation. In UML tools you have to "code generate" and "reverse engineer" between the code and a model that holds additional metadata (such as whether a particular association is an aggregation).

    Tony Loton

    Co-author, Professional Visual Studio 2005 Team System, http://www.amazon.com/gp/product/0764584367

     

     

     

  • Wednesday, June 14, 2006 3:29 AMImesh Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi Tony,

    Thanks  a lot for your reply.

    Best regards,

    Imesh

  • Friday, August 17, 2007 10:24 AMVikasGoyalMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Will nested class be example of aggregation/composition  ?

    Nested class is supported by C#.


    http://DotNetWithMe.blogspot.com
    vikas goyal