Article ID | Journal | Published Year | Pages | File Type |
---|---|---|---|---|
434989 | Science of Computer Programming | 2015 | 25 Pages |
•We present an approach for Behavioral Programming (BP) in JavaScript (JS) and Blockly.•The approach allows for intuitive incremental development of reactive applications.•We propose design patterns for interfacing with external environments from BP in JS.•We demonstrate BP programs in Blockly and in JS for interactive client side applications.•We introduce a small tool for smartphone customization based on interwoven scenarios.
We combine visual programming using Google Blockly with a single-threaded implementation of behavioral programming (BP) in JavaScript, and propose design patterns for developing reactive systems such as client-side Web applications and smartphone customization applications as collections of independent cross-cutting scenarios that are interwoven at run time. We show that BP principles can be instrumental in addressing common software engineering issues such as separation of graphical representation from logic and the handling of inter-object scenarios. We also show that a BP infrastructure can be implemented with limited run-time resources in a single-threaded environment using coroutines. In addition to expanding the availability of BP capabilities, we hope that this work will contribute to the evolving directions of technologies and design patterns in developing interactive applications.