Stream graph granularity
Design stream graphs with readability and reusability in mind, similar to the process you follow when you design operators.
In Streams Processing Language (SPL), stream graphs in composite operators must be kept to a manageable size. When the number of operators in a stream graph reaches the point that it is difficult to think about all of them at once, logically separate related subgraphs into composite operators of their own. This practice is useful both for indicating that a group of operators is strongly related, and to avoid repeating the same operator pattern multiple times.
Create composite operators out of related operators in both an iterative and continual process. If appropriate, programmers further subdivide the composite operators that they create and continue this process when the application is in development. In this manner, composite operators serve as a similar abstraction mechanism in SPL as functions in C and C++ and as classes in Java™. A good rule of thumb is to divide the streams graph into composites when there are more than 10 operators or it contains more than 100 lines of code.