title: How best to handle duplicated code across platforms/tiers?
body: <p>I'm curious about how everyone handles code duplication across multiple platforms/tiers.</p>
  
  <p>As an example, in our application we have a screen that displays claims.
  A claim is deemed to be outstanding if it satisfies certain critera and users want to see which claims are outstanding in their lists, so there is one piece of code in the application that does this.</p>
  
  <p>We then also have reports that are entirely separate from the application, and users want reports of all their outstanding claims.
  As there is no way to create a claim entity and see if it is outstanding from the report it seems that we necessarily have to have some duplication of code.</p>
  
  <p>You could have a function or something in the database that provides this information and your single piece of code, but you're then solely relying on the db for business logic and you'd have to do a round trip to the db for each claim you want to check in the app, not exactly ideal!</p>
  
  <p>So, how does everyone handle situations like this and are there any best practices I should be aware of?</p>