DEV Community

Simon Brown
Simon Brown

Posted on

13 1

Modelling multiple relationships

The topic of how to model multiple relationships between the same two elements has come up a number of times this week, so here's a quick tip.

To explain the situation, imagine you have an online book store that has customers. Those customers can do a number of things; make purchases, make pre-orders, browse, search, view their previous orders, and so on. To describe this with a diagram, many people would simply draw two boxes, and have one arrow per major use case/feature/story/etc. That would look something like this.

Multiple relationships

While correct and accurate, this approach tends to clutter the diagram, and each time you add a new major feature, you need to add another arrow.

A better way to think about this is that there's a single relationship between the customer and the online book store. Perhaps the customer "uses" the online book store or, to be more descriptive, perhaps the customer "browses and makes purchases using" the online book store.

A single relationship

If you do want to show each of the major use cases/features/stories/etc and how they work at runtime, you can do that with a unique dynamic diagram for each of those use cases/features/stories. With this approach, essentially what you have is a single relationship in the static model, with each dynamic diagram showing an instance of that relationship.

I hope that helps!

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay