Context-Oriented Behavioral Programming

被引:13
|
作者
Elyasaf, Achiya [1 ]
机构
[1] Ben Gurion Univ Negev, Dept Software & Informat Syst Engn, Beer Sheva, Israel
关键词
Behavioral programming; Scenario-based programming; Programming paradigm; Context awareness; Context-oriented programming; Context-Oriented Behavioral Programming;
D O I
10.1016/j.infsof.2020.106504
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Context: Modern systems require programmers to develop code that dynamically adapts to different contexts, leading to the evolution of new context-oriented programming languages. These languages introduce new software-engineering challenges, such as: how to maintain the separation of concerns of the codebase? how to model the changing behaviors? how to verify the system behavior? and more. Objective: This paper introduces Context-Oriented Behavioral Programming (COBP) - a novel paradigm for developing context-aware systems, centered on natural and incremental specification of context-dependent behaviors. As the name suggests, we combine behavioral-programming (BP) - a scenario-based modeling paradigm - with context idioms that explicitly specify when scenarios are relevant and what information they need. The core idea is to connect the behavioral model with a data model that represents the context, allowing an intuitive connection between the models via update and select queries. Combining behavioral-programming with context-oriented programming brings the best of the two worlds, solving issues that arise when using each of the approaches in separation. Methods: We begin with providing abstract semantics for COBP and two implementations for the semantics, laying the foundations for applying reasoning algorithms to context-aware behavioral programs. Next, we exemplify the semantics with formal specifications of systems, including a variant of Conway's Game of Life. Then, we provide two case studies of real-life context-aware systems (one in robotics and another in IoT) that were developed using this tool. Throughout the examples and case studies, we provide design patterns and a methodology for coping with the above challenges. Results: The case studies show that the proposed approach is applicable for developing real-life systems, and presents measurable advantages over the alternatives - behavioral programming alone and context-oriented programming alone. Conclusion: We present a paradigm allowing programmers and system engineers to capture complex context-dependent requirements and align their code with such requirements.
引用
收藏
页数:19
相关论文
共 50 条
  • [1] Context-Oriented Behavioral Programming
    Elyasaf, Achiya
    Information and Software Technology, 2021, 133
  • [2] Context-oriented Programming
    Hirschfeld, Robert
    Costanza, Pascal
    Nierstrasz, Oscar
    JOURNAL OF OBJECT TECHNOLOGY, 2008, 7 (03): : 125 - 151
  • [3] An Introduction to Context-Oriented Programming with ContextS
    Hirschfeld, Robert
    Costanza, Pascal
    Haupt, Michael
    GENERATIVE AND TRANSFORMATIONAL TECHNIQUES IN SOFTWARE ENGINEERING II, 2008, 5235 : 396 - +
  • [4] TinyCORP: A Calculus for Context-Oriented Reactive Programming
    Kamina, Tetsuo
    Aotani, Tomoyuki
    PROCEEDINGS OF THE WORKSHOP ON CONTEXT-ORIENTED PROGRAMMING (COP'19), 2019, : 1 - 8
  • [5] A framework for analyzing context-oriented programming languages?
    Elyasaf, Achiya
    Cardozo, Nicolas
    Sturm, Arnon
    JOURNAL OF SYSTEMS AND SOFTWARE, 2023, 198
  • [6] Towards Runtime Adaptation in Context-Oriented Programming
    Han, Bo
    Zhao, Yinliang
    Zhu, Changpeng
    Zeng, Qinghua
    2013 10TH INTERNATIONAL CONFERENCE ON ELECTRICAL ENGINEERING, COMPUTING SCIENCE AND AUTOMATIC CONTROL (CCE), 2013, : 201 - 208
  • [7] Context-Oriented Programming with the Ambient Object System
    Gonzalez, Sebastian
    Mens, Kim
    Cadiz, Alfredo
    JOURNAL OF UNIVERSAL COMPUTER SCIENCE, 2008, 14 (20) : 3307 - 3332
  • [8] Context-oriented programming: A software engineering perspective
    Salvaneschi, Guido
    Ghezzi, Carlo
    Pradella, Matteo
    JOURNAL OF SYSTEMS AND SOFTWARE, 2012, 85 (08) : 1801 - 1817
  • [9] Reconciling Context-Oriented Programming and User Interface Adaptation
    Duhoux, Benoit
    PROCEEDINGS OF THE ACM SIGCHI SYMPOSIUM ON ENGINEERING INTERACTIVE COMPUTING SYSTEMS (EICS'18), 2018,
  • [10] ReactCOP: Modular and ScalableWeb Development with Context-Oriented Programming
    Lorenz, David H.
    Shmuel, Ofir
    COMPANION PROCEEDINGS OF THE 2023 ACM SIGPLAN INTERNATIONAL CONFERENCE ON SYSTEMS, PROGRAMMING, LANGUAGES, AND APPLICATIONS: SOFTWARE FOR HUMANITY, SPLASH COMPANION 2023, 2023, : 63 - 64