I am currently designing a system that will need to match event object E to an object C, with properties being defined in configuration. There will be multiple objects to match with in the configuration. E has many properties, and comes from an external system. The configuration will be generic, in that you can define any property within multiple C objects to match E. For example, take this event E passed to the system:
E.a = 1
E.b = 2
...
E.z = 26
C objects defined in configuration:
C1.b = 2
C1.z = 21
C2.c = 3
C2.d = 4
C2 would return as matching to E.
I know the naive algorithm would be to iterate through all fields in each C to match to E, but I am wondering if that is the fastest way to find a match for E within all C objects. Any thoughts?
Aucun commentaire:
Enregistrer un commentaire