Flow Based Programing 是由J. Paul Rodker Morrison在很早以前提出的一种编程范式。
维基百科对FBP的定义如下:
In computer programming, flow-based programming (FBP) is a programming paradigm that defines applications as networks of "black box" processes, which exchange data across predefined connections by message passing, where the connections are specified externally to the processes. These black box processes can be reconnected endlessly to form different applications without having to be changed internally. FBP is thus naturally component-oriented.
在github的这个https://github.com/samuell/awesome-fbp项目内列举了很多不同语言对该范式的实现以及一些资料,大家可以参考。
很多年前我用Python开发了一个基于流概念的数据处理工具。当时主要是想解决让不懂编程的数据工程师能够通过构建图形化的数据流来达到数据获取,变形和抽取的功能。这么多年过去了,我整理了一下代码,丰富了一下基本功能,构建了简单的运行UI,算是有个初步的雏型,看看能不能分享给社区做些贡献。
项目在这里:
其实利用Flow的概念在软件项目中很常见。例如:
- Apache NiFi
- DAG in spark