From Stringly to Strongly Typed

Imagine a D&D character sheet. It has typed fields (Strength 1 to 18, Class is Fighter or Wizard or Rogue) and rules between them (Halflings can’t be Paladins, Hit Points depend on Class and Constitution). The blank sheet is the schema ; a filled-in character is one instance of it. If you only have one schema, you can just write a CharacterSheet data class with the right fields plus some…