Object Composition in Scenario-Based Programming ⋆ Yoram Atir, David Harel, Asaf Kleinbort, and Shahar Maoz The Weizmann Institute of Science, Rehovot, Israel {yoram.atir,dharel,asaf.kleinbort,shahar.maoz}@weizmann.ac.il Abstract. We investigate the classical notion of object composition in the framework of scenario-based specification and programming. We con- centrate on live sequence charts (LSC), which extend the classical par- tial order semantics of sequence diagrams with universal/existential and must/may modalities. In order to tackle object composition, we extend the language with appropriate syntax and semantics that allow the spec- ification and interpretation of scenario hierarchies – trees of scenarios – based on the object composition hierarchy in the underlying model. We then describe and implement a composition algorithm for scenario hier- archies, and discuss a trace-based semantics and operational semantics (play-out) for the extension. The extension has been fully implemented, and the ideas are demonstrated using a small example application. 1 Introduction Building upon the preliminary (unpublished) work in [3], we integrate object composition with scenario-based specification and programming. Object com- position, that is, the ‘part-of’ hierarchical relation, is a fundamental concept in object oriented analysis and design [5]. We consider strong composition, for which part-objects are intrinsically associated with their whole, and do not ex- ist independently. Scenarios, depicted using variants of sequence diagrams, are popular means for specifying the inter-object behavior of reactive systems (see, e.g, [8, 12, 18, 20]), are included in the UML standard [19], and are supported by many modeling tools. To specify scenarios we use a UML2 compliant variant of live sequence charts (LSC) [7, 10], a visual formalism that extends classical message sequence charts (MSC) [13], mainly by making a distinction between possible and mandatory behavior. The LSC language has an executable (opera- tional) semantics (play-out) [11], and thus may be used not only for requirements and specification but also as a programming language. We define an appropriate extension of the syntax and semantics of LSC, which allows the specification and interpretation of a scenarios hierarchy that ⋆ This research was supported in part by The John von Neumann Minerva Center for the Development of Reactive Systems at the Weizmann Institute of Science and by a Grant from the G.I.F., the German-Israeli Foundation for Scientific Research and Development.