April 18, 2019
What happens when there is the need to write data in a distributed system? What if this data needs to go to different services? How do services participate in this process like they do for the Composition part? This is when ViewModel Decomposition comes into play. Let's have a look at what it is and especially when it's really needed.
Composing a list in an efficient way is complex. Multiple components need to interact with each other to produce the final result. It's not that different from a chorus, where each dancer performs the studied choreography so that the end result is an amazing ballet.
At a first look it might sound reasonable to use ViewModel Composition to allow services to talk to each other. Why not allowing services to share complex data structure composed at runtime? Let me put it simple: you don't want a distributed monolith!