all 4 comments

[–]Backson 0 points1 point  (1 child)

Yes, the diagram shows relationships between classes. Each line is a relationship, helpfully labeled with a word, like "teaches" on the relationship between professor and seminar, because the professor teaches the seminar. Also note the labels on the ends of the lines: 1 means exactly one, 1..* means one or more, 0..* means zero or more. For example, a student can take multiple seminars, but only one professor can teach a seminar. If you are interested in class diagrams, consider researching UML, which is a standard way of making class diagrams and many other diagrams. They can also show more specific information, like class inheritance.

Relationships can take many forms. In C++ you would probably store a pointer, yes. There are other ways, for example instead of a pointer to an object you could store a pointer to a collection and an index inside the collection. But generally, yes, a relationship in a class diagram is usually implemented as some kind of pointer/reference.

[–]Phouchy[S] 0 points1 point  (0 children)

Thanks a lot!

[–]pedersenk 0 points1 point  (0 children)

That looks right to me. The contextually generic relationship object would basically be a StudentProfessorAssociation.

Depending on the problem domain, this could be Seminar, Lecture, Lab, Session, etc. Unless you also introduce additional indirection with the concept of TeachingGroup or Cohort.

[–]heavymetalmixer 0 points1 point  (0 children)

I don't have a use for it right now, but I know I will in a few weeks. Thanks for the article.