I'm trying to implement a solution that will allow me to look-up a description for an entity, sort of like a translation look-up. The catch is the description can vary not just by the language of the user, but by a possibly varying subset of a known set of dimensions. Examples of such dimensions might be language, region, user agent/media, UI component, etc. Furthermore if one queries by a set of criteria for which an exact match is not found, the closest match needs to be chosen. For example for a query by language and region, if the entity only has a description specified per language, the description for that language should be the result.
In terms of design goals and non-goals:
- The super set of dimensions for which a description could be looked up is not likely to change, but if the design accommodates additions all the better.
- I'm familiar with the One True Look-up Table (OTLT) anti-pattern, but for what it's worth I do foresee needing to be able to have conditional descriptions for more than just one type of entity.
I'm not trying to have anyone do my homework here, but in my search for prior art I'm struggling to come up with search terms that are bearing fruit. Should I be looking more towards a general purpose rules engine for this, or is there a standard SQL based solution that would fit the bill? If the latter any references or suggested search terminology would be most appreciated.