title: Entity relationship modeling: how to implement entity "roles"?
body: <p>I've done a bit of reading on data modeling recently and have a question about roles that an entity may play.</p>
  
  <p>Consider a simple case where you've got a Company, and a Company can be a Supplier, Customer, Distributor, etc. or a combination of these roles.  So company X might be both a Supplier and a Customer.</p>
  
  <p>Down at the data level you might have a table for CompanyS and then tables for SupplierS, CustomerS, etc that reference the Company table.  At least I think this is how it might be represented.</p>
  
  <p>Ok, so somewhere up in application-land you've got classes for CustomerS and SupplierS and so on.  Each would be composed of a Company, and then whatever else is special about that particular class.</p>
  
  <p>That's all ok and makes sense to me as long as we're only working with one entity class at a time.  What if we want to start with a Company and see what roles it's playing?  So in an application I might pull up a Company and see that it is a Supplier and a Distributor.</p>
  
  <p>Now there are a few different ways I can think of to do this, but I feel that because this problem domain is so old that there must be some tried and true patterns for modeling these concepts. </p>
  
  <p>Thus what I am in search of here are common strategies or patterns for modeling entity roles up at the application level.  Specific reference material about this particular subject would be greatly appreciated (be it blogs or books or whatever).</p>