NoFlo - Flow-Based Programming for Node.jsPresentation Transcript
Flow-Based Programming for Node.js
http://bergie.iki.fihenri.bergius@iki.fi @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 programmingparadigm that defines applications as networks of blackbox processes, which exchange data across predefinedconnections by message passing, where the connectionsare specified externally to the processes. These blackbox processes can be reconnected endlessly to formdifferent applications without having to be changedinternally. FBP is thus naturally component-oriented.” - Wikipedia
Flow-based programming
“Flow-Based Programming was invented byJohn Paul Morrison [from IBM] in the early1970s, and an early implementation of thistechnology has been in continuous productionuse at a major Canadian bank since that time.” - Wikipedia
Softwarearcheology?
“This is the Unix philosophy: Write programsthat do one thing and do it well. Writeprograms to work together. Write programsto handle text streams, because that is auniversal interface.” - Doug McIlroy
“I thought of objects being like biologicalcells and/or individual computers on anetwork, only able to communicate withmessages (so messaging came at the verybeginning -- it took a while to see how to domessaging in a programming languageefficiently 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 flowssend string package.json to source port of Read send output of Read to Split (by lines) send output of Split to Count send output of Count to Display
NoFlo shell
NoFlo in integration email External partners CouchDB + CouchApp Project NoFloController External systems github.com/iks/proggis
NoFlo in integrationgithub.com/iks/proggis
NoFlo in real world
What happens next?● Web-based drawing ● Hook.io support● Web-based ● Component loading monitoring & debug from NPM
Flow-Based Programming, the book amzn.com/1451542321
Flow-Based Programming for Node.jsgithub.com/bergie/noflo
github.com/bergie/noflo Screenshot: github.com, couple of weeks ago
Let LinkedIn power your SlideShare experience
+
Let LinkedIn power your SlideShare experience
Customize SlideShare content based on your interests
We will import your LinkedIn profile and you will be visible on SlideShare.
Keep up to date when your LinkedIn contacts post on SlideShare