|
|
|
|
|
by adrianratnapala
3396 days ago
|
|
I think languages should have built in help for serialisation, though not tied to a particular format. This is to get around the tension between automating the process (avoiding boiler-plate) versus "gating" to validate and transform data as it enters/leaves the domain model. All serialisation frameworks I've seen map internal record types (structs, objects) to an external schema, and write directly to record fields -- breaking down that "gate". What I would like is to map those schema to something like a constructor/factory parameter list instead. (Python keyword arguments come close, but the lack of typing means there is still no schema). Serialisation libraries should confine themselves to converting between (typed) key-value pairs and wire formats. Then there should be syntactic sugar to help the transition between that plain-old data and the real domain model. |
|