title: Java - Should I use a field or a class for the problem as follows:
body: <p>I have two tables in the DB</p>
  <ul>
  <li><b>FuelStation</b> (fuel_station_id: int (PK), fuel_station_name: varchar, fuel_brand_id: int(FK))</li>
  <li><b>FuelBrand</b> (fuel_brand_id: int (PK), fuel_brand_name: varchar)</li>
  </ul>
  <p>As we can see, both tables are linked via. foreign key (fuel_brand_id)</p>
  <p>Now, I want to design an object model corresponding to the above data model but I am confused which approach to use from the following two approaches:</p>
  <ul>
  <li>Whether to make only one class <b><code>FuelStation</code></b> and store fuel brand as <b><code>String</code></b> in the <b><code>FuelStation</code></b> class.</li>
  </ul>
  <p>OR</p>
  <ul>
  <li>Make two classes: <b><code>FuelStation</code></b> and <b><code>FuelBrand</code></b>. And then associate them with a <b>Many-to-One</b> relationship as one <b>fuel station</b> will have only one <b>fuel brand</b> but one <b>fuel brand</b> can have many <b>fuel stations</b>.</li>
  </ul>
  <p>Q1. Which approach is better?</p>
  <p>Q2. What are the pros and cons of each approach?</p>
  <hr />
  <blockquote>
  <p><b>Upto My Knowledge:</b></p>
  <p>Pros of Approach 2</p>
  <ul>
  <li><p>It has made our object model more granular.</p>
  </li>
  <li><p>Acc. to good design principles, our object-model must be atleast as granular as relational-model. And approach2 follows that principle</p>
  </li>
  </ul>
  <p>Pros of Approach 1</p>
  <ul>
  <li>No need to create a separate object for <b>FuelBrand</b> for every <b>FuelStation</b></li>
  </ul>
  </blockquote>