noflo - flow-based programming for node.js

31
Flow-Based Programming for Node.js

Upload: henri-bergius

Post on 28-May-2015

5.856 views

Category:

Technology


6 download

TRANSCRIPT

Page 1: NoFlo - Flow-Based Programming for Node.js

Flow-Based Programming for Node.js

Page 2: NoFlo - Flow-Based Programming for Node.js

http://bergie.iki.fi [email protected]

@bergie

Page 3: NoFlo - Flow-Based Programming for Node.js

Call-Return

Page 4: NoFlo - Flow-Based Programming for Node.js

Continuation-Passing Style

Page 5: NoFlo - Flow-Based Programming for Node.js

JavaScript, the Ugly Parts

Page 6: NoFlo - Flow-Based Programming for Node.js

Promises

Page 7: NoFlo - Flow-Based Programming for Node.js

Hooks

Page 8: NoFlo - Flow-Based Programming for Node.js

How to make your code manageable?

Page 9: NoFlo - Flow-Based Programming for Node.js

Clean separation of concerns

Page 10: NoFlo - Flow-Based Programming for Node.js

Visualized connections between components

Page 11: NoFlo - Flow-Based Programming for Node.js

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

Page 12: NoFlo - Flow-Based Programming for Node.js

Flow-based programming

Page 13: NoFlo - Flow-Based Programming for Node.js

“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

Page 14: NoFlo - Flow-Based Programming for Node.js

Software archeology?

Page 15: NoFlo - Flow-Based Programming for Node.js

“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

Page 16: NoFlo - Flow-Based Programming for Node.js

“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

Page 17: NoFlo - Flow-Based Programming for Node.js
Page 18: NoFlo - Flow-Based Programming for Node.js

send options 'a, u & x' to command 'ps',send option 'firefox' to command 'grep'direct standard output of 'ps' to 'grep'

Page 19: NoFlo - Flow-Based Programming for Node.js

NoFlo components

Page 20: NoFlo - Flow-Based Programming for Node.js

Using NoFlo in your Node.js app

Page 21: NoFlo - Flow-Based Programming for Node.js

Using NoFlo in your Node.js app

Page 22: NoFlo - Flow-Based Programming for Node.js

DSL for specifying flows

Page 23: NoFlo - Flow-Based Programming for Node.js

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

Page 24: NoFlo - Flow-Based Programming for Node.js

NoFlo shell

Page 25: NoFlo - Flow-Based Programming for Node.js

NoFlo in integration

CouchDB+

CouchAppProject

Controller

Externalpartners

Externalsystems

email

NoFlo

github.com/iks/proggis

Page 26: NoFlo - Flow-Based Programming for Node.js

NoFlo in integration

github.com/iks/proggis

Page 27: NoFlo - Flow-Based Programming for Node.js

NoFlo in real world

Page 28: NoFlo - Flow-Based Programming for Node.js

What happens next?

● Web-based drawing ● Web-based

monitoring & debug

● Hook.io support● Component loading

from NPM

Page 29: NoFlo - Flow-Based Programming for Node.js

Flow-Based Programming, the book

amzn.com/1451542321

Page 30: NoFlo - Flow-Based Programming for Node.js

Flow-Based Programming for Node.js

github.com/bergie/noflo

Page 31: NoFlo - Flow-Based Programming for Node.js

github.com/bergie/noflo

Screenshot: github.com, couple of weeks ago