I have two objects with attributes:
Object 1:
Person
Object 2:
PersonRule
- Personname
- Person location
- The character
PersonRule is controlled by a user interface that sets a user rule (it can also set a lot), and the user says what name, location, age should be in the rule. This rule must be mapped to a person if the person has the same value for the attributes.
I can do a simple equality check, but itโs also possible that in the future a new attribute is added to the personโs rule, something like personaddress. Then I need to check if the rule matches the character by accepting the address of the person.
Is there a way to build something like matching all personrule attributes for a person, so that I donโt need to make changes when a new attribute is added to the rule? Of course, this assumes that the corresponding attribute is available in the person object.
Thanks, -Mike
source share