Scala Reactive Programming
上QQ阅读APP看书,第一时间看更新

What is a Marble diagram?

A Marble diagram is a diagram used to visualize an FRP Data Transformation in a very nice and easy-to-understand form. (Refer to the next section to understand what an FRP Data Transformation is.)

Using these diagrams, we can understand the following things very well about an FRP Data Transformation:

  • A data element or a set of data elements are emitted or produced from a source (Producer, Publisher, or a data stream)
  • A data element or a set of data elements flow in that data stream, that is, they are produced from the source and flow through that data stream
  • What data transformation is happening in that data stream?
  • How that data stream is picking each element and how it is performing that data transformation for each and every element or only a set of elements
  • The way it is preparing the final results after performing that data transformation
  • How that data stream is sending the final results to the destination (another Producer, Publisher or a data stream, or maybe a Consumer or Subscriber)

Before starting the discussion about some sample Marble diagrams, I feel it's good to know what an FRP Data Transformation is. Let's define it now.