Closed krl closed 8 years ago
My idea is that we control the creation of the merkledag.Node
type. and prevent it from being created by a user, then we introduce a type called merkledag.MutableNode
(or something less java-ey) that is used for constructing and modifying dags. Doing this will more closely follow the semantics of 'immutable dags' that ipfs really pushes.
I think:
merkledag.Node // immutable
merkledag.MutableNode
:+1: is a good idea.
(MutableNode
is only two words-- not too unidiomatic. if we end up with anything that matches MutableNode(Factory|Abstract)+
though...)
merkledag.MutableMerkledagNodeFactoryBuilderImpl.GetFactoryBuilderInstance()
closing this for now... things will change with ipld.
"we should start thinking about making Merkledag nodes immutable and having a separate type for changing them"
I'd be interested in having a discussion on this topic, since immutable datastructures is a love of mine. @whyrusleeping could you elaborate?