Search Knowledge

© 2026 LIBREUNI PROJECT

UML Design / Summary

UML Design Decisions

Designing with UML: Best Practices

Modeling is not just about drawing; it’s about making architectural decisions. Here is how to navigate common design challenges.

1. The “Attribute vs. Entity” Decision

When modeling a piece of data (e.g., Address), ask:

  • Does it have its own identity? If yes -> Entity (Class).
  • Does it need its own validation or logic? If yes -> Entity.
  • Is it a primitive value? If yes -> Attribute.
  • Can it change independently of its container? If yes -> Entity.

2. Choosing the Right Diagram

Don’t use every diagram for every feature. Pick based on what you need to communicate:

GoalDiagram Type
High-level requirementsUse Case
Logic/WorkflowsActivity
Static structure/DatabaseClass
Time-sensitive interactionSequence
Complex object lifecycleState Machine
System deployment/NetworkDeployment

3. Granularity: How much detail?

  • Analysis Level: Focus on concepts and domain. Ignore technical details like ID fields or getters/setters.
  • Design Level: High detail. Include types, visibility, and specific design patterns (e.g., Singleton, Factory).

4. Mapping UML to Implementation

  • Generalization maps to extends.
  • Realization maps to implements.
  • Composition is usually implemented as a field initialized in the constructor.
  • Aggregation is usually a field passed in via a setter or constructor parameter.
  • State Machines map well to the State Pattern.
  • Activity Flows map to method logic or Chain of Responsibility.

5. The Power of Code (PlantUML)

Always prefer text-based modeling over graphical tools for:

  • Maintainability: Changing a relationship is a text edit, not a mouse struggle.
  • Consistency: High-quality diagrams every time.
  • Collaboration: Easy to review design changes in pull requests.

Summary Checklist

  1. Identify the Actors and their Goals.
  2. Define the Domain Model (Classes and their core relationships).
  3. Visualize Critical Paths (Sequence diagrams for complex interactions).
  4. Map to Physical Architecture (Deployment).
  5. Iterate! UML is meant to be a living document during the design phase.