4 ms·
Imagine multiple nodes. In order to communicate between them, they need some kind of connection, this is coupling. When you have too many connections the applic
by ttty 12y ago
Imagine multiple nodes. In order to communicate between them, they need some kind of connection, this is coupling. When you have too many connections the application is hard to maintain and extend. The connections are all on the same layer, therefore is too confusing.
Now think of a tree. Now imagine the nodes being some points on the branches on the tree. If one node want to communicate with another, it has to go down to the joint node and then go up to the target node. This will increase the indirection (and of course is less performant), you will have to pass data (and callbacks) between components but there are no global connections. In this way you make your application easier to edit and is less coupled.
Hope you understood something (: maybe I will write a post with some images on my blog ;)
- nightski 12y agoThe connections are not all on the same layer in Knockout. It does not seem like you have ever used it? It uses a hierarchy/tree of binding contexts. For dependent values you have a computed binding which creates an implicit dependency which triggers a change whenever it's dependency changes. It works very well in my experience.