0

I'm making a class diagram for my school project, an Inventory Management System. So far, I've made the use-case and activity diagrams, however, I'm struggling with the class diagram and mostly because of this one thing (stated in the title). Here's my diagram so far: enter image description here

See how I use the same string "products" in Manufacturer and Stock. Is that okay? Or should I do something else (make one of the strings public etc)?

emcosokic
  • 11
  • 3

1 Answers1

0

UML does not define a strict semantics on how associations are implemented in code (or, when used as a replacement for ER modeling, in a database schema).

Depending on the intended purpose of the diagram and the programming language, the developer / modeler / software engineer can decide whether they need a rigid form of implementation, or not. An implementation may use pointers, references or IDs, it may be done unidirectional or bidirectional, and sometimes it is just done implicitly by some values/references which can be derived from other values. Sometimes, the form of implementation of an association is intentionally left open.

So when you draw some UML diagram as a replacement for ERMs, it is up to you to make a decision which semantics you give the drawn associations and if you want or need a specific form of foreign keys to be linked with those.

Related: answer to a question from 2013 on UML semantics

Doc Brown
  • 199,015
  • 33
  • 367
  • 565