title: O.O.P and Class Properties
body: <p>I'm new to O.O.P and would like advice on best practice. </p>
  
  <p>Say for example I have a Course class which holds course information, and a Location class which holds location details. Classes have corresponding repository classes. Now, each Course HAS A location which I have added Location as a property. </p>
  
  <p>When I am pulling the details of a Course from the database, is it best practice to:
  A – Populate the Location object from within the CourseRepository Class meaning SQL would return both course and location details
  B – Only populate Course object, returning the Location ID, then use the LocationRepository class to find the location details</p>
  
  <p>I’m leaning more towards B as this is a separation of responsibility, however, the thing that’s getting me is performance. Say I need a List instead which returns a result of 50. Would it be wise to query SQL 50 times to seek location details? Would appreciate your thoughts on this. </p>
  
  <p>Lewis</p>