title: How to map fields in an object to another dynamically?
body: <p>I have 2 objects with attributes as the following:</p>
  
  <p>Object 1:</p>
  
  <p>Person</p>
  
  <ul>
  <li>Name</li>
  <li>Location</li>
  <li>Age</li>
  <li>Address</li>
  </ul>
  
  <p>Object 2:</p>
  
  <p>PersonRule</p>
  
  <ul>
  <li>PersonName</li>
  <li>PersonLocation</li>
  <li>PersonAge</li>
  </ul>
  
  <p>The PersonRule is driven by an UI, which sets a person rule(can set many as well), and the user says what name, location, age should be in a rule. This rule should be matched against a person if the person has the same value for the attributes.</p>
  
  <p>I can do a simple equality check, however it's also possible that in the future a new attribute is added to person rule, something like a personaddress. Then I need to do a check whether the rule matches person by taking person address also into consideration.</p>
  
  <p>Is there a way I can build something like match all attributes of personrule to person attributes, so that I don't need to make changes when a new attribute gets added to the rule? Of course this is assuming that the corresponding attribute is available in person object.</p>
  
  <p>Thanks,
  -Mike</p>