Book a Demo

Author Topic: Any Way to Show C# Partial Class Parts as One?  (Read 3496 times)

JohnWSaundersIII

  • EA User
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Any Way to Show C# Partial Class Parts as One?
« on: April 14, 2010, 02:50:44 am »
This is in C#.

I have a class model where many of the classes are related by the fact that they realize a common set of interfaces. The interfaces are part of a generalization hierarchy themselves.

In some cases, the realization is specified in a second partial class. When laid out, the various parts of the class may be in totally different areas of the diagram, completely obscuring the relationships between them.

Is there a way to keep the parts near each other, or to show them as a single class?
John Saunders

fwoolz

  • EA User
  • **
  • Posts: 435
  • Karma: +0/-0
  • We have met the enemy, and he is us.<Pogo, 1970>
    • View Profile
Re: Any Way to Show C# Partial Class Parts as One?
« Reply #1 on: April 14, 2010, 07:12:33 am »
I second this... Visual Studio doesn't distinguish between the "halves" of a partial class in Class View; EA should provide some mechanism for unifying the "halves" as well. I can understand the difficulty in preserving the apportioning of fields and operations between the different pieces of code if partial classes are "merged" into a single class in EA, but having the two "halves" act pretty much as separate classes rather than parts of the same whole as at present is clumsy at best. In addition, the attribute "partial" is a code artifact, not a UML feature; logically, the "partial" class sections constitute a single definition corresponding to what should be a single UML class. This is not unlike the case with .cpp and .h files, except that in the case of C# partial classes there is no clear way of determining which bits go into which code files unless the bits are explicitly mapped with their proper destinations.
« Last Edit: April 14, 2010, 07:21:27 am by fwoolz »
Fred Woolsey
Interfleet Technology Inc.

Always be ready to laugh at yourself; that way, you beat everyone else to the punch.