DEV Community

KienTPhan
KienTPhan

Posted on

How to use UML Diagrams for better communication

Why I think you should learn UML Diagrams?

I think it can help a lot when explaining complex concept. It is very easy to get caught up in the weeds when talking to another developer and miss the whole reason for the conversation. Having a diagram keeps me from caring so much about the details and allow more higher level thinking.

Another benefit I think it helps with is understanding a new system. If you force yourself to map out a system into a diagram, it helps you visualize it and learn the system. It is also great for sharing this knowledge or refreshing your mind in the future. The bonus of learning a system by drawing out a diagram is you end up with a diagram in the end that could be use as documentation for your team!

Diagram types

  • structural
  • behavioral

Structural diagram

Structural diagrams helps explain the actual parts inside your system like model classes and their relationships.

Behavior diagram

Behavior diagrams helps explain some process like clicking a button and the light turns on.

What are the most useful UML Diagrams for developer in my opinion

  • class diagram
  • sequence diagram
  • use case diagram

class diagram

Shows a class and their members and its relationship with other classes.

class diagram image

sequence diagram

sequence diagram image

Diagram is good for mapping out the flow of function calls during an execution between the instances of classes. It is a great compliment on top of class diagram. It shows how the class instances interact with each other.

Use case diagram

Use case diagram image

It is another behavioral diagram that helps map out how a system operate with different user behaviors.

Component diagram

This is used when planning the architecture of a project. This help abstract out complex system into components and show their interaction with each other.

other types

  • state diagram
  • deployment diagram

tips

  • keep diagrams scope narrow to avoid clutter
  • make sure to have a purpose and audience for the diagram
  • remember the purpose is to communicate something, so don't overthink it

software to use

Note: you can just use paper and pen.

My recommendation for software is draw.io. It's free easy to install and has great integration with Notion.

source

source 1

Top comments (0)