Is there a way to represent an UML association class in MySQL EER?

Viewed 37

I am converting an UML class diagram to an EER diagram in MySQL. Is there a way to represent the following association class in MySQL EER diagram?

enter image description here

I know it is a concept called "gerund", but I want to know exactly how to achieve it. I tried doing it by making a table AB between A and B, connecting it to A and B with identifying relationships and connecting AB to C with normal relationship.

But I wonder if that is exactly it.

1 Answers

An association class in UML is something semantic to think at a high level about features that do belong to neither A nor B but are specific to the relation between the two, independently of the way it could be implemented.

If you need to implement this in a database, you’d probably refactor the high-level design diagram to make an implementation model that takes into account the technology used (e.g. RDBMS vs NoSQL).

The technique that is used to this purpose in an RDBMS context is indeed the association table mapping. This pattern is exactly as you describe. And if you model your implementation using a tool-specific EER, you could use it as EQUIVALENT to the association class.

Note that in a one-to-many « "relation", a shortcut could be to combine in a single table A and C. But this has the disadvantage of coupling two independent concepts. So better stay with your association table.

Now, is it EXACTLY the same? No, because the association class is implementation independent. Depending whereas the association table is implementation specific (i.e. it is relevant in an RDBMS technology, but could be irrelevant in an in-memory implementation).

Remark: ERD are not standardized models as there are several alternative notations. Neither are EERD: there are several non-standardized alternatives with no authoritative definition. If you have the opportunity, prefer using UML for the full spectrum and use EERD only if forced due to the context

Related