Home > other >  What difference between semantic and structural relationships?
What difference between semantic and structural relationships?

Time:12-17

According to the UML specification and other valid resources, association is both a semantic relationship and a structural relationship.

There are questions:

  • What is the semantic relationship?
  • What is structural relationship?

CodePudding user response:

You could simply look into a dictionary. (Here it's Oxford)

Semantic

relating to meaning in language or logic.

Structure

the arrangement of and relations between the parts or elements of something complex: flint is extremely hard, like diamond, which has a similar structure.

  • a building or other object constructed from several parts. [...]

Structure is what you can see. E.g. you can see lots of bricks glued together. That's the structure. The semantics will be "house" (if it's that) or could be "art" as well as "ruin". So the semantics is what you interpret a structure to be.

Relationships are no different. You can see the connection between two classes. But what it means will be defined by semantics. You will need some context to determine it. Once you have that (requirements, explanatory SDs etc.) you're done.

  • Related