Programming Coordinated Behavior in Java

David Harel, Assaf Marron, Gera Weiss · 2010

Abstract. Following the scenario-based approach to programming which centered around live sequence charts (LSCs), we propose a general ap-proach to software development in Java. A program will consist of mod-ules called behavior threads (b-threads), each of which independently de-scribes a scenario that may cross object boundaries. We identify a proto-col and a coordination mechanism that allow such behavioral program-ming. Essentially, runs of programs are sequences of events that result from three kinds of b-thread actions: requesting that events be considered for triggering, waiting for triggered events, and blocking events requested by other b-threads. The coordination mechanism synchronizes and inter-laces b-threads execution yielding composite, integrated system behavior. The protocol idioms and the coordination mechanism of b-threads are implemented as a Java library called BPJ. Throughout the exposition we illustrate benefits of the approach and discuss the merits of behavioral programming as a broad, implementation-independent paradigm. 1

Read the paper · More papers on PaperTik