mercredi 4 novembre 2015

How to implement bi-directional assosiation between Classes?

I am trying to design software for video rental. I would like Movie class to have list of Actor * who acted in the movie. I would also like Actor to have list of Movie *, in which he has acted.

  1. How to ensure that there is no inconsistency between the two lists?

  2. How to initialize Movie object, whose Actor Object is not present[but will have to be created]?

Aucun commentaire:

Enregistrer un commentaire