"Flow-Based
Programming", 2nd
Edition, is now available on Kindle
and Lulu
(EPUB format),
as
well
as
in
paperback
form from Amazon
and CreateSpace.
For
more
information
see
below.
Go with the flow!

Herakleitos,
in about 500 BC, said ![]() usually translated as "Everything changes". What he actually said was: "Everything flows". |
The second edition of the book, "Flow-Based Programming", appeared in 2010, 16 years after the first edition, and is available from CreateSpace eStore and Amazon.com - also in ebook format, from Kindle and Lulu. Take a look and see how FBP has changed over the past 16 years!
The new edition contains information about the Java and C# implementations, as well as the diagramming tool (DrawFBP), several sections contributed by Mike Beckerle, CTO of Oco Inc., on his experience using FBP concepts on truly humongous amounts of data, plus a whole new chapter on software projects that have appeared in the last 16 years and either build on FBP, or have strong similarities to it. And, of course, FBP is the obvious technology for application development involving multi-processor computers and networks of computers, so this is addressed in several of the chapters.
For obvious reasons, the new sections are not available on this web
site - but just think, you could have a shiny new copy in your hands,
printed with loving care by CreateSpace - and IMHO
it looks just as
good as the original edition (if not better)!
"Flow-Based Programming, 2nd
Edition" is also available in ebook format from:
You can download the book in
seconds from either of these sites. In neither case do you need
e-reader hardware:
I should
mention that ebook versions provide live links and
cross-references on your PC or appropriate readers (although the tables
aren't
quite as legible as in the printed version - apparently this is a
general problem with ebooks).
Apparently, you can arrange for a referral fee to be paid to the
King's College, Cambridge, Library. To do this you simply go to
http://www.kings.cam.ac.uk/library/amazon-store.html,
and
search for
Flow-Based Programming. The Amazon UK web site will come up, but
the King's College Library will still receive a referral fee.
Please make sure you order the 2nd Edition (the one marked 14 May 2010).
Table
of
contents:
A Google Group has been started for FBP - see FBP
Google Group. To send the group a message, click on messages to
Google group. Don't forget the wiki about FBP - FBP
Wiki - although nobody seems to have contributed to it in
quite a
while, probably
due
to changing fashions in the industry, there is still
a lot of good stuff on the wiki, contributed by a lot of very smart
people!
I have recently set up a bulletin board
to manage
discussions about FBP and its implementations - the idea is to use it
mainly for implementation details at a lower level than those discussed
in the Google group. I would appreciate feedback on its
usefulness, usability, etc.
Justin Bozonier has written what Google called a "knol" (unit of knowledge) on Flow-Based
Programming, but knols have been migrated to WordPress, and the
migrated version can be viewed on Flow-Based
Programming
on
WordPress
(Annotum) - great job, Justin!
There is a Wikipedia article on Flow-Based Programming - please feel free to extend it in any direction that you feel would enhance its usefulness.
There is a wiki about FBP - FBP
Wiki - nobody seems to have contributed to it in quite a
while, probably
due
to changing fashions in the industry. The active discussion seems
to have shifted to the Google Group mentioned above, but there is still
a lot of good stuff on the wiki, contributed by a lot of very smart
people!
Information about the author of this web page: J. Paul Morrison.
Flow-Based Programming is a new/old approach to application development, based on a completely different way of thinking about building applications. Some of its roots can be traced all the way back to the early days of computing, yet it offers solutions to many of the most pressing problems facing application development today.
Not surprisingly parts of the answer have been presaged many times over in the past, but the 1st edition (1994) of my book on the subject, "Flow-Based Programming", van Nostrand Reinhold, 1994, ISBN 0-442-01771-5 was the first book to tie together many of these different efforts, and to point towards a very practical, powerful, yet perfectly realizable future of application development. The 2nd edition came out with the assistance of CreateSpace in 2010 - Flow-Based Programming, 2nd Edition: A New Approach to Application Development, CreateSpace, 2010, ISBN 1451542321 - and contains contributions from a number of people who have been working with the technology over the last 16 years. It is also available in ebook format from Amazon.com and Lulu.com.
In "Flow-Based Programming" (FBP), applications are defined as networks of "black box" processes, which exchange data across predefined one-way connections. These black box processes can be reconnected endlessly to form different applications without having to be changed internally. It is thus naturally component-oriented. To describe this capability, Raoul de Campo of IBM Research coined the term "configurable modularity", and it was later adopted and developed by the distinguished IBM engineer, Nate Edwards, who described it as "the basis of all true engineered systems."
When using FBP, the application developer works with flows of data, being processed asynchronously, rather than the conventional single hierarchy of sequential, procedural code. This means that the precise timing of events can usually not be predicted exactly, which tends to make old-style programmers nervous. However, it turns out that this isn't really necessary (and never has been!), and in fact shifts the emphasis from sequences of actions to transformations performed on streams of data.
FBP is thus a good fit with multiprocessor computers, and also with modern embedded software. In many ways, an FBP application resembles more closely a real-life factory, where items travel from station to station, undergoing various transformations. Think of a soft drink bottling factory, where bottles are filled at one station, capped at the next and labelled at yet another one. FBP is therefore highly visual: it is quite hard to work with an FBP application without having the picture laid out on one's desk, or up on a screen! For an example, see a portion of a batch program (you have to zoom in to see some of the connections). This diagram, which was built using the earlier C++ DrawFBP diagramming tool, only shows part of an extremely complex program, which was running almost daily for over 30 years (it has since been replaced). Now imagine building the same function using a conventional programming language!
Strangely though, in spite of being at the leading edge of application development, it is also simple enough that trainee programmers can pick it up, and it is a much better match with the primitives of data processing than the conventional primitives of procedural languages.
In recent years, the concept seems to have started to take off - this seems to be coinciding with a feeling that Object-Oriented isn't the perfect solution to all our problems that it was originally believed to be. More and more projects and papers use the term Flow-Based Programming (often in lower case) - to the point where it has started to be a generic term (like Bandaid in N. America!). For a fairly lengthy list of projects, papers, and even companies, that seem to be using related concepts, see the Wiki page called "Flowlike Projects".
As you might guess from the logo, a project has been registered on SourceForge. Source code for Java and C# implementations of the concepts has been uploaded to SourceForge, as well as a picture-drawing tool that supports many of its concepts (see DrawFBP).
The earliest implementations of FBP concepts are described in the Introduction to the book, and were built for IBM mainframes.
For PCs, there was an early implementation called THREADS, also described in the book, followed by Java (JavaFBP) and C# (C#FBP) implementations (developed after the book was published). The network syntax and component API are described in THREADS API and Network Specification .
The latest version of JavaFBP is available on SourceForge and also on the FBP web site in non-executable jar file format - JavaFBP jarfile. Its network syntax and component API are described in "JavaFBP Network Syntax and Component API".
The latest version of C#FBP is available on SourceForge and on the FBP web site - C#FBP zipfile. Its network syntax and component API are described in "C#FBP Network Syntax and Component API".
A new feature of both of these releases is the addition of metadata (or "attributes") to components, giving port names and characteristics, and the "must run" attribute. This is intended to allow diagramming tools to display port names and use this information for various types of checking. If you are currently working with a previous version of JavaFBP, the metadata will have to be added to your existing components, but this only has to be done once, and hopefully will not be too onerous.
A new, much more powerful, Java version of the DrawFBP diagramming tool is now available.
Last but not least, I am starting to have more time available, and I hope to move more into research on Flow-Based Programming (of course). As the signs are that FBP is finally starting to take off, I am hoping that interested individuals will start to contact me about ideas and possibilities in this area. In particular, I am looking for organizations that are willing to share their experience (and even componentry) with other organizations. If we could pool our resources, as is done in the Open Source community, we could bootstrap our productivity, and everyone benefits! Another interesting area where collaboration could take place is in the design and management of component repositories.
The first edition of the book is now out of print, but is still listed at Amazon.com , and it is also on-line in two formats: a copy in PDF format, and individual browsable chapters - listed below. The second edition is now available from CreateSpace eStore and Amazon.com., plus, as stated above, in ebook format from Kindle and Lulu (EPUB format).
Two reviews of "Flow-Based Programming" appeared a few years ago in one of the Australian computer journals, one by Tony Stevenson, then at Monash University, and the other by Andrew Wenn, of Victoria University of Technology (Footscray). The latter has a pretty complete description of FBP and of the contents of the book, as well as some (well-deserved) criticisms! To see them, click on Stevenson, and Wenn, respectively.
Ed Yourdon has kindly added my book to his list of "cool books".
There are some papers on FBP on my web site. Not surprisingly, there is some duplication as it is generally necessary to give a short description of the basic concepts in each one, but each paper has some unique sections. Here they are:
"Asynchronous Component-Based Programming." (contains some stats on typical application component counts)
"Flow-Based Programming" (contains some statistics on reuse)
"Flow-Based Programming" in "Application Developers' News" - Journal for Developers of Heterogeneous Computing Systems
The first implementation of the concepts of FBP for the PC was written in C, and was called THREADS. It used the Borland C compiler. It is described in the first edition of my book, "Flow-Based Programming", specifically in the Appendix (see "THREADS API and Network Specification"). The code is in the process of being upgraded to use Win32 and "fibres" - I have put it up on my web site, called THREADS_32. As it is fibre-based, it cannot make use of multiple processors, but initial testing suggests that, on the other hand, it is very fast! Although the revised code has survived some of its early tests, it obviously needs a lot more testing before it becomes "industrial strength".
I would like to change the name to CppFBP, and in fact this name has started to be used in the code, but the book refers to it as THREADS_32, so I will retain that name for the zip file, for the time being.
I am also uncertain how to implement component metadata, which I consider an important feature of the Java and C# implementations, so this is currently unsupported.
A Java implementation of Flow-Based Programming which we have called JavaFBP (formerly JFBP, formerly JavaFlow) is now available in open source form, and has been registered as a project on SourceForge, and the code has been uploaded onto the SourceForge File release System. It can be accessed by clicking here: SourceForge. To download the source code, click on "files", and then download the latest release. An earlier version was uploaded onto the CVS server on SourceForge, but it is not up-to-date.
The code (version 2.6) is also available on this web site. To download it, click here: JavaFBP jar file (you may have to shift and click).
This implementation was written by John Cowan and tweaked by me. It allows a developer to specify an application as a network of nodes, which are long-running Java threads, connected by fixed-capacity connections, over which data objects travel. We feel this approach lends itself to server applications where high throughput is required. It is easy to multiplex components that are either I/O-bound or CPU-bound (in the latter case this allows us to take advantage of the multiple processors in current machines). The network is also specified as a Java program, which we feel is a more flexible approach than designing a special-purpose language for this purpose.
There is a web page describing the syntax of a JavaFBP network definition and showing a sample JavaFBP component - information will be added to this page as time permits. To see it, click on JavaFBP Network Syntax and Component API.
JavaFBP also supports "static subnets" - an example can be found in the jar file, and there is a fairly complete description of how it works in Composite Components, particularly in the second half, including "substream sensitivity".Please feel free to look at the code, and/or contact me for more information, or to give me feedback.
As of version 2.5, the following features were added (also described in JavaFBP Network Syntax and Component API) :
As of version 2.6, JavaFBP now checks that components only receive and send packets containing data of the type specified in the class annotations. This uses the Java isAssignableFrom() method - e.g. if the port annotations specify Object (the default), this port may send or receive packets containing anything.
Input ports and input port array elements are automatically optional
-
this has not changed since earlier releases.
Please note that, as of the 2.5
version, process names and port names may only contain Unicode
letters, figures, underscore and blank, as suggested by one of
JavaFBP's registered users. We hope this does not disturb any
current applications, but we judged this was necessary to protect the
extension possibilities for JavaFBP. A similar change will be
made to C#FBP shortly.
The following notice has been added to all the source files (updating the dates as required):
static final String copyright =As stated in the copyright notice, you can look at a document describing this license by clicking on Clarified Artistic License .
"Copyright 2007, ... 2012, J. Paul Morrison. At your option, you may copy, " +
"distribute, or make derivative works under the terms of the Clarified Artistic License, " +
"based on the Everything Development Company's Artistic License. A document describing " +
"this License may be found at http://www.jpaulmorrison.com/fbp/artistic2.htm " +
"THERE IS NO WARRANTY; USE THIS PRODUCT AT YOUR OWN RISK.";
Several years ago, Amanda Ge kindly converted the pre-5.0 Java version to C#, but did not have time to test it. With input from David Bennett in Melbourne, Australia, I have upgraded my C# implementation and it is now available on SourceForge and on my web site. There is a readme file describing the new features.
The new version of C#FBP can be found at C#FBP (you may have to shift and click), and on SourceForge. The source code is now available on SourceForge SVN. Please feel free to play with it - and let me know how you make out. I will of course post updates as required. If you have already taken a copy, please download the latest version!
A page has been added to this site describing the syntax of a C#FBP network definition and a sample C#FBP component - information will be added to this page as time permits. To see it, click on C#FBP Network Syntax and Component API.
Several years ago, a picture-drawing tool which supports many of the concepts of FBP was written in C++ for Windows. It can still be obtained by clicking here: DrawFBP-C++, but it has now been superseded by a Java version, which can be obtained by clicking here: DrawFBP Installer, and this is also available on SourceForge - look for the 2.8 version. This version is much more powerful, has fairly decent help facilities, and can generate runnable Java, C# or NoFlo network definitions, if it is given enough information. You can now draw an application, click on "Generate Network", fill in a few missing bits of information (if any), and voilà - a running program! What's not to like?!
For more information about DrawFBP, click on this link.