title: Has and belongs to many vs. has many through
body: <p>This isn't another should I use HABTM or HMT question. Honest. That said, I <em>am</em> going to ask whether people would use HABTM or HMT in the following situation.</p>
  
  <ul>
  <li>I have a model "Book".  </li>
  <li>I want to add a model "Author".  An Author has_many Books.  A Book has_many Authors.</li>
  <li>I want to add a model "Topic".  A Topic has_many Books.  A Book has_many Topics.</li>
  </ul>
  
  <p>I already know the difference between the two assocations, I know about join tables, and I know (generally) the benefits to each association system.</p>
  
  <p>Clearly I can set up two HABTM relationships here. </p>
  
  <p>However, it struck me that I could also be witty and put my foreign_ids in the "Books" model table by declaring Authors and Topics as "has_many :authors/topics, :through => :books".</p>
  
  <p>My question is whether people think this is an over-abstraction of the database structure, given that the primary relationship is between BOOKS and AUTHORS, and BOOKS and TOPICS, and is not the direct relationship between AUTHOR and TOPIC?</p>
  
  <p>Put another way, it seemed that while I get to do away with two (extra) join tables and use the more flexible HMT relationship, I might be diluting the point of my database, which was to store BOOKS, which then link to AUTHORS and TOPICS.</p>
  
  <p>I thought this was a relatively interesting question.</p>
  
  <p>Also, all the other examples on the Internet I could find of the use of HMT used the "through" table as a relatively insignificant portion of the database.  For example
  - using it as a "through" table to store grades of STUDENTS who took TESTS;
  - to store info about magazine subscriptions of SUBSCRIBERS who subscribed to MAGAZINES.  </p>
  
  <p>I've never seen an example where the "through" table stores primary information.  It seems to be more for storing ancillary information about the two main tables that it joins.</p>