jasonravagli / gym-manager

0 stars 0 forks source link

Bidirectional N:N relationship and domain model improvements #3

Closed jasonravagli closed 2 years ago

jasonravagli commented 2 years ago

The bidirectional relationship can cause performance issues (N+1 queries) when retrieving data from the database and could be difficult to handle without an ORM framework. The relationship should go from Course to Member only. Regarding the java classes, only the Course class should have a list of the subscribed Members. List of Courses must be removed from the Member class.

Set should be used instead of List: the same Member cannot be subscribed multiple times to a Course.