This dichotomy is a bit silly, when we can be selective about what we expose to the JSON serializer. The real reason for this being separate, was the Manager system, but that's hopefully going away in #6. Hoo-rah.
Tricky bit will be deserialization. We don't want to trust the external system's hashing, but we probably also don't want to distrust it in an expensive way. So we'll need a Validate() function that checks all the items to be sure they live in the right hash, moving them if necessary, and completely reconstructing the ThingByGroup fields in the process.
Come to think of it, this will probably require the logic/model unification to happen first. Ick. I was hoping to do this as an incremental step leading up to the unification, but considering that the files will need to serialize and deserialize Events and Quorums....
This dichotomy is a bit silly, when we can be selective about what we expose to the JSON serializer. The real reason for this being separate, was the Manager system, but that's hopefully going away in #6. Hoo-rah.
Tricky bit will be deserialization. We don't want to trust the external system's hashing, but we probably also don't want to distrust it in an expensive way. So we'll need a Validate() function that checks all the items to be sure they live in the right hash, moving them if necessary, and completely reconstructing the ThingByGroup fields in the process.
Come to think of it, this will probably require the logic/model unification to happen first. Ick. I was hoping to do this as an incremental step leading up to the unification, but considering that the files will need to serialize and deserialize Events and Quorums....