How do I implement the following class? (second try)
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8462928/how-do-i-implement-the-following-class">How do I implement the following class?</a>  </p>
</blockquote>



<p>I am writing a personal library management project for an exam, using C++. The library consists of lists of <code>Book</code>, <code>Film</code> and <code>Album</code> objects (with the same base class <code>Media</code>) and a set of <code>Person</code> objects. The user can Add and Remove entries in these sets.
These sets save (and load) their data in separate text files, with the structure I reported here:</p>

<p><a href="http://stackoverflow.com/questions/8444052/how-to-parse-the-following-text-file-into-class">How to parse the following text file into class?</a></p>

<p>As you can notice from the structure, I can't assign IDs to the entries.</p>

<p>I must implement a class <code>Loan</code>, with a field referring to a <code>Media</code> and one referring to a <code>Person</code> stored in the lists above mentioned. Moreover the set of <code>Loans</code> must be saved to a text file.</p>

<p>My question is how to refer to the instances <code>person</code> and <code>media</code> in the class Loan. Is it good to refer to their position in their list (or array)? Or should I implement the list so that, for example, only one Media with the same title and author are allowed?</p>
