I have 2 objects with attributes as the following:
Object 1:
Person
- Name
- Location
- Age
- Address
Object 2:
PersonRule
- PersonName
- PersonLocation
- PersonAge
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.
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.
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.
Thanks, -Mike