How to restrict a Generalized Data Model at run time ?
I'm building a data model for data in motion, using Object modelling, that generates a json-schema.
The model is rather generalized so it can be used to trade on several products. It is not possible , nor desirable to create sub-classes for each product.
Generalization comes at a price: loss of semantic in the model and loss of constraints.
Do you know any way to add "information" to the model so it is clear that if you run a transaction for Product A you have to use a certain set of classes and attributes, and if you run transaction of Product B you have to use another set.
So, best of both: a generalized data model bringing flexibility but coming with information that helps understanding what is required at run time by trade processors to populate depending on Product.
Thanks in advance for bouncing any ideas
Since JSON has very little metadata, the only way to make that clear to users, added documentation will be required. Or maybe you are able to craft a json-schema where specifics for ProductA or ProductB are resolved/indicated using references ("$ref") as used in the Address examples on the json schema pages?