Billy Newman wrote:Ok i agree that was a bad example.
Is this still a good design or is there a better way to associate those?
The question is why are you looking for a better way to do it than simple loop over all values?
Is your code is a performance bootleneck, or maybe it consumes to much memory ?
If no - keep it as simple as possible, simple loop will be easier to understand/maintain by someone else,
or even by you in two years, when you will completely forget why this stuff is so complicated and how it works.