DJDNS / go-deje

Golang library for DEJE Next, a protocol/technology for decentralized document hosting and concurrent editing.
GNU Lesser General Public License v2.1
8 stars 0 forks source link

Handle group management within Document #6

Closed MaddieM4 closed 10 years ago

MaddieM4 commented 10 years ago

We don't need separate manager logic. We can include the following items in the Document struct:

type Document struct {
    Topic string
    State *state.DocumentState
    Events EventSet
    EventsByParent map[string]EventSet
    Quorums QuorumSet
    QuorumsByEvent map[string]QuorumSet
}

This is not only much clearer about grouping, it sets the stage for unifying the logic and model packages.

The only question is whether these fields should be publicly exposed, or limited to API-access (to preserve their read-only-ness). I think it makes sense to publicly expose them, with warning labels. I'm not the downstream user's mom. I'd also probably be returning non-copied maps from some functions for efficiency anyways, and it's actually less obvious that those objects should not be fiddled with. I'd rather be fully open and not wrap everything in functions that have to be written and tested (and can either protect the user from himself or go fast, but not both).

MaddieM4 commented 10 years ago

I didn't have a good "cherry" commit - something that would work well as a finishing touch, and could be prefixed with "Close #6". Even so, I think this is done enough for now. Time to move on to other stuff.