noflo - flow-based programming for node.js
TRANSCRIPT
Flow-Based Programming for Node.js
http://bergie.iki.fi [email protected]
@bergie
Call-Return
Continuation-Passing Style
JavaScript, the Ugly Parts
Promises
Hooks
How to make your code manageable?
Clean separation of concerns
Visualized connections between components
Flow-based 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.”
- Wikipedia
Flow-based programming
“Flow-Based Programming was invented by John Paul Morrison [from IBM] in the early 1970s, and an early implementation of this technology has been in continuous production use at a major Canadian bank since that time.”
- Wikipedia
Software archeology?
“This is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.”
- Doug McIlroy
“I thought of objects being like biological cells and/or individual computers on a network, only able to communicate with messages (so messaging came at the very beginning -- it took a while to see how to do messaging in a programming language efficiently enough to be useful).”
- Alan Kay
send options 'a, u & x' to command 'ps',send option 'firefox' to command 'grep'direct standard output of 'ps' to 'grep'
NoFlo components
Using NoFlo in your Node.js app
Using NoFlo in your Node.js app
DSL for specifying flows
DSL for specifying flows
send string 'package.json' to source port of Readsend output of Read to Split (by lines)
send output of Split to Countsend output of Count to Display
NoFlo shell
NoFlo in integration
CouchDB+
CouchAppProject
Controller
Externalpartners
Externalsystems
NoFlo
github.com/iks/proggis
NoFlo in integration
github.com/iks/proggis
NoFlo in real world
What happens next?
● Web-based drawing ● Web-based
monitoring & debug
● Hook.io support● Component loading
from NPM
Flow-Based Programming, the book
amzn.com/1451542321
Flow-Based Programming for Node.js
github.com/bergie/noflo
github.com/bergie/noflo
Screenshot: github.com, couple of weeks ago