title: Design pattern for filtering a collection of items?
body: <p>Imagine the typical type of application where you have a list of items with different properties. E.g. a tree-view with 100 items, each having a <em>name</em>, a <em>rating</em>, a <em>rank-within-the-hottest-items-on-the-planet</em> etc. Probably there are also many-to-many relationships between <em>items</em> and <em>item-catalogs</em>, or between <em>items</em> and <em>item-creators</em> etc etc.  </p>
  
  <p>Now this application naturally needs a filtering system. E.g. where I can construct complex filters with multiple conditions of all kinds, between data in different relationships.</p>
  
  <p>The design task of writing such a filtering feature ought to be something MANY developers have done and there surely must be some kind of design pattern which is the most suitable for the task.</p>
  
  <p>Anyone? </p>
  
  <p><strong>Edit:</strong> Switched to community wiki since I suspect there isn't any industry de factor pattern used for this. Question too generally formulated I guess.</p>