IBM Streams 4.2

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™. When a stream graph reaches approximately 10 operators, or contains more than 80 lines of code, subdivide the graph into composites. The structure of the stream graph itself is readily apparent.