Search code examples
c#classumldiagram

UML Class Diagram - Do we include partial classes like usercontrols and MainWindow here?


I am working on a project and I am not very sure about how to do this. I have all my classes in my UML diagram, but I am not sure if I have to include partial classes like usercontrols here. My code is in C# if that matter.

I think I don't have to do it but I want to see others opinion on the matter.

Thanks


Solution

  • UML is neutral about what you should include as class in your model. So it's your choice. And the choice will depend on your development method and what you want to achieve.

    For example, the Unified Software Development Process, defined by the fathers of UML, Booch, Jacobson & Rumbaugh, propose different levels of modelling:

    • Analysis classes are derived from use-cases and follow the Entity-Control-Boundary approach
    • Design classes are derived from analysis model and correspond to the classes to be implemented.

    Other methods, such as AgileUP, are more pragmatic, and start with a domain model focused on persistent classes corresponding to the business concepts. The design model enriches the domain classes with other classes invovled in the implementation (e.g. UI, application controls, persistence utilities, etc.)

    Moreover, there is a difference between the classes in a model, and the subset of classes that you show in a diagram for discussing a particular aspect of your design.

    Additional context (i.e. purpose of your UML model and metodology) is needed for more specific advice.