In modern software development with JavaScript, an asynchronous execution model is often adopted to prevent freezing execution triggered by the blocking operations. JavaScript is now used in various types of applications for the Web, smartphones, and server-side due to its rich ecosystem. In such applications, programmers implement several concerns that should perform different behavior according to the current identified context. Context-Oriented Programming (COP) posits layers as an abstraction to manage such concerns. With COP, programmers can implement context dependent application behavior in a layer, then (de)activate such layers when the context changes, leading to a change in the system behavior. Additionally, COP offers different scoping strategies which define when and how layers should be (de)activated. The dynamic extent of layers is one of such scoping strategies, which encapsulates the duration of a layer within a block, then deactivates the layer when the block execution ends. However, applying an asynchronous execution model breaks the semantics of dynamic extent because the result of an asynchronous execution generally returns when the caller of the asynchronous execution goes through the block. Existing work proposes a variant of the dynamic extent that activates a layer for a block and its logically-connected asynchronous operations by keeping information across them. However, that proposal only supports one of three kinds of asynchronous operations used in JavaScript (MacroTask, EventTask, and MicroTask). This paper extends on the existing work to support a layer activation mechanism with a scoping strategy that fulfills all three kinds of asynchronous operations in JavaScript. We show the benefit of our proposal through the implementation of a real world application for smartphones.
{"title":"Layer Activation Mechanism for Asynchronous Executions in JavaScript","authors":"Hiroaki Fukuda, Paul Leger, Nicolás Cardozo","doi":"10.1145/3570353.3570354","DOIUrl":"https://doi.org/10.1145/3570353.3570354","url":null,"abstract":"In modern software development with JavaScript, an asynchronous execution model is often adopted to prevent freezing execution triggered by the blocking operations. JavaScript is now used in various types of applications for the Web, smartphones, and server-side due to its rich ecosystem. In such applications, programmers implement several concerns that should perform different behavior according to the current identified context. Context-Oriented Programming (COP) posits layers as an abstraction to manage such concerns. With COP, programmers can implement context dependent application behavior in a layer, then (de)activate such layers when the context changes, leading to a change in the system behavior. Additionally, COP offers different scoping strategies which define when and how layers should be (de)activated. The dynamic extent of layers is one of such scoping strategies, which encapsulates the duration of a layer within a block, then deactivates the layer when the block execution ends. However, applying an asynchronous execution model breaks the semantics of dynamic extent because the result of an asynchronous execution generally returns when the caller of the asynchronous execution goes through the block. Existing work proposes a variant of the dynamic extent that activates a layer for a block and its logically-connected asynchronous operations by keeping information across them. However, that proposal only supports one of three kinds of asynchronous operations used in JavaScript (MacroTask, EventTask, and MicroTask). This paper extends on the existing work to support a layer activation mechanism with a scoping strategy that fulfills all three kinds of asynchronous operations in JavaScript. We show the benefit of our proposal through the implementation of a real world application for smartphones.","PeriodicalId":340514,"journal":{"name":"Proceedings of the 14th ACM International Workshop on Context-Oriented Programming and Advanced Modularity","volume":"28 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2022-06-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"128322855","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Monitoring information technology systems during operation is one of the few methods available to help administrators keep track of the monitored system’s state, predict and identify errors, and assist in system repair and error avoidance. Monitoring solutions to date, however, still suffer from various trade-offs as current implementations impose architectural restrictions on monitored systems, which lead to reduced flexibility in deployment and operation. Most monitoring software is specialized to function with fixed specific data formats, protocols, and data acquisition mechanisms, further reducing their flexibility. The role-based approach for modeling and implementing software promises an intuitive way of increasing the flexibility of information technology systems’ modeling and implementation. Paired with technology on control loops from the domain of self-adaptive systems, we can create a reusable framework made from static role-playing building blocks that allow overcoming those limitations. In this paper, a novel concept and model for a flexible monitoring solution on this basis is presented, which provides functioning in most application domains while minimizing architectural and functional constraints on the monitored system. We compare the flexibility of our concept with a collection of 15 monitoring systems based on 11 criteria. We further illustrate the concept by presenting and discussing a uniform role-based model and, finally, discussing one possible implementation method.
{"title":"Modeling flexible Monitoring Systems with a Role-Based Control Loop","authors":"Ilja Shmelkin, L. Schütze, Tim Kluge","doi":"10.1145/3570353.3570356","DOIUrl":"https://doi.org/10.1145/3570353.3570356","url":null,"abstract":"Monitoring information technology systems during operation is one of the few methods available to help administrators keep track of the monitored system’s state, predict and identify errors, and assist in system repair and error avoidance. Monitoring solutions to date, however, still suffer from various trade-offs as current implementations impose architectural restrictions on monitored systems, which lead to reduced flexibility in deployment and operation. Most monitoring software is specialized to function with fixed specific data formats, protocols, and data acquisition mechanisms, further reducing their flexibility. The role-based approach for modeling and implementing software promises an intuitive way of increasing the flexibility of information technology systems’ modeling and implementation. Paired with technology on control loops from the domain of self-adaptive systems, we can create a reusable framework made from static role-playing building blocks that allow overcoming those limitations. In this paper, a novel concept and model for a flexible monitoring solution on this basis is presented, which provides functioning in most application domains while minimizing architectural and functional constraints on the monitored system. We compare the flexibility of our concept with a collection of 15 monitoring systems based on 11 criteria. We further illustrate the concept by presenting and discussing a uniform role-based model and, finally, discussing one possible implementation method.","PeriodicalId":340514,"journal":{"name":"Proceedings of the 14th ACM International Workshop on Context-Oriented Programming and Advanced Modularity","volume":"107 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2022-06-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"123204040","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
M. Brand, Stefan Ramson, Jens Lincke, R. Hirschfeld
Implicit Layer Activation (ILA) is a declarative mechanism to scope behavior adaptations in Context-oriented Programming (COP). ILA binds the activation status of a layer to a Boolean condition. The layer is active as long as the given condition evaluates to true. This mechanism to scope layer activations is very powerful, but without dedicated tool support, it may be hard to debug due to its implicitness. A solution that can mitigate this is proper tool support, which is expensive to build and can be highly domain-specific. We have previously shown that by building the language extension not from scratch but by relying on a common more powerful shared concept, Active Expressions, the implementation becomes simpler and more elegant since it does not require deep integration into the ContextJS implementation. In this paper we show how providing tool support for ILA makes implicit dependencies to state changes more explicit. We show how such tool support can be implemented by leveraging the existing Active Expression tool suite. We illustrate the usage based on a catalog of COP questions from literature.
{"title":"Explicit Tool Support for Implicit Layer Activation","authors":"M. Brand, Stefan Ramson, Jens Lincke, R. Hirschfeld","doi":"10.1145/3570353.3570355","DOIUrl":"https://doi.org/10.1145/3570353.3570355","url":null,"abstract":"Implicit Layer Activation (ILA) is a declarative mechanism to scope behavior adaptations in Context-oriented Programming (COP). ILA binds the activation status of a layer to a Boolean condition. The layer is active as long as the given condition evaluates to true. This mechanism to scope layer activations is very powerful, but without dedicated tool support, it may be hard to debug due to its implicitness. A solution that can mitigate this is proper tool support, which is expensive to build and can be highly domain-specific. We have previously shown that by building the language extension not from scratch but by relying on a common more powerful shared concept, Active Expressions, the implementation becomes simpler and more elegant since it does not require deep integration into the ContextJS implementation. In this paper we show how providing tool support for ILA makes implicit dependencies to state changes more explicit. We show how such tool support can be implemented by leveraging the existing Active Expression tool suite. We illustrate the usage based on a catalog of COP questions from literature.","PeriodicalId":340514,"journal":{"name":"Proceedings of the 14th ACM International Workshop on Context-Oriented Programming and Advanced Modularity","volume":"44 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2022-06-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"123875820","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Adaptive programming models are increasingly important as context-dependent software conquers more domains. One such a model is role-oriented programming where behavioral changes are implemented by objects playing and renouncing roles. As with other adaptive models, the overhead introduced by source code adaptations is a major showstopper for role-oriented programs. This is in part because the optimizations of object-oriented virtual machines (VMs) do not provide the same performance gains when applied to role-oriented programs. Recently, dispatch plans have been shown to enable optimizations beyond those in VMs, thereby improving the performance of role programs with low variability. This paper introduces guarded dispatch plans, an extension of dispatch plans with a context-aware guarding mechanism that allows reuse in high-variability scenarios. Fine-grained guards use run-time feedback to partially reuse dispatch plans across call sites when contexts are changing. We present an algorithm to construct and compose guarded dispatch plans and provide a reference implementation of the approach. We show that our approach is able to gracefully degrade into a default dispatch approach when variability increases. The implementation is evaluated with synthetic benchmarks capturing different characteristics. Compared to the state-of-the-art implementation in ObjectTeams we achieved a mean speedup of 3.3 × in static cases, 3.0 × at low variability and the same performance in highly dynamic cases.
{"title":"Guard the Cache: Dispatch Optimization in a Contextual Role-oriented Language","authors":"L. Schütze, Cornelius Kummer, J. Castrillón","doi":"10.1145/3570353.3570357","DOIUrl":"https://doi.org/10.1145/3570353.3570357","url":null,"abstract":"Adaptive programming models are increasingly important as context-dependent software conquers more domains. One such a model is role-oriented programming where behavioral changes are implemented by objects playing and renouncing roles. As with other adaptive models, the overhead introduced by source code adaptations is a major showstopper for role-oriented programs. This is in part because the optimizations of object-oriented virtual machines (VMs) do not provide the same performance gains when applied to role-oriented programs. Recently, dispatch plans have been shown to enable optimizations beyond those in VMs, thereby improving the performance of role programs with low variability. This paper introduces guarded dispatch plans, an extension of dispatch plans with a context-aware guarding mechanism that allows reuse in high-variability scenarios. Fine-grained guards use run-time feedback to partially reuse dispatch plans across call sites when contexts are changing. We present an algorithm to construct and compose guarded dispatch plans and provide a reference implementation of the approach. We show that our approach is able to gracefully degrade into a default dispatch approach when variability increases. The implementation is evaluated with synthetic benchmarks capturing different characteristics. Compared to the state-of-the-art implementation in ObjectTeams we achieved a mean speedup of 3.3 × in static cases, 3.0 × at low variability and the same performance in highly dynamic cases.","PeriodicalId":340514,"journal":{"name":"Proceedings of the 14th ACM International Workshop on Context-Oriented Programming and Advanced Modularity","volume":"16 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2022-06-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"129250715","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Yudai Tanabe, Luthfun Anshar Lubis, Tomoyuki Aotani, H. Masuhara
λVL is a core calculus based on the concept of programming with versions that supports multiple versions of program definitions and values inherently in the semantics of a language. However, since λVL was not designed as a surface language, its complex syntax and semantics only provide primitive constructs to manipulate versioned values. In order to realize the programming with versions concept in a real-world language, we propose a compilation method for functional languages through λVL and discuss how real-world programs can be written in a Haskell-like functional language with versions.
{"title":"A Step toward Programming with Versions in Real-World Functional Languages","authors":"Yudai Tanabe, Luthfun Anshar Lubis, Tomoyuki Aotani, H. Masuhara","doi":"10.1145/3570353.3570359","DOIUrl":"https://doi.org/10.1145/3570353.3570359","url":null,"abstract":"λVL is a core calculus based on the concept of programming with versions that supports multiple versions of program definitions and values inherently in the semantics of a language. However, since λVL was not designed as a surface language, its complex syntax and semantics only provide primitive constructs to manipulate versioned values. In order to realize the programming with versions concept in a real-world language, we propose a compilation method for functional languages through λVL and discuss how real-world programs can be written in a Haskell-like functional language with versions.","PeriodicalId":340514,"journal":{"name":"Proceedings of the 14th ACM International Workshop on Context-Oriented Programming and Advanced Modularity","volume":"108 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2022-06-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"127971260","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
A cyber range is a virtual training ground for security experts. Trainees are separated into attacking and defending teams, whose roles are either to compromise or to protect some critical infrastructure. As reuse of a same scenario may significantly reduce training efficiency, recent research proposed to automate the process of defining and deploying arbitrarily complex cyber range scenarios through the use of a virtual scenario description language (VSDL). However, it remains a challenge to generate VSDL scenarios dynamically, i.e. in an adaptive manner, to avoid having to redefine new VSDL scenarios for each new situation. Moreover, existing VSDLs often consider limited contextual information (e.g., only the virtualization budget) and do not link explicitly the vulnerabilities of their scenarios together, which prevents from proposing scenarios with more advanced cyber security exploits. In this vision paper, we rely on feature-based context-oriented modelling to generate relevant cyber range scenarios from an explicit user profile and exploits described in attack-defence trees. This result has high industrial potential, as it could enable a kind of on-demand cyber range scenario generation service.
{"title":"Generating Virtual Scenarios for Cyber Ranges from Feature-Based Context-Oriented Models: A Case Study","authors":"P. Martou, K. Mens, Benoît Duhoux, Axel Legay","doi":"10.1145/3570353.3570358","DOIUrl":"https://doi.org/10.1145/3570353.3570358","url":null,"abstract":"A cyber range is a virtual training ground for security experts. Trainees are separated into attacking and defending teams, whose roles are either to compromise or to protect some critical infrastructure. As reuse of a same scenario may significantly reduce training efficiency, recent research proposed to automate the process of defining and deploying arbitrarily complex cyber range scenarios through the use of a virtual scenario description language (VSDL). However, it remains a challenge to generate VSDL scenarios dynamically, i.e. in an adaptive manner, to avoid having to redefine new VSDL scenarios for each new situation. Moreover, existing VSDLs often consider limited contextual information (e.g., only the virtualization budget) and do not link explicitly the vulnerabilities of their scenarios together, which prevents from proposing scenarios with more advanced cyber security exploits. In this vision paper, we rely on feature-based context-oriented modelling to generate relevant cyber range scenarios from an explicit user profile and exploits described in attack-defence trees. This result has high industrial potential, as it could enable a kind of on-demand cyber range scenario generation service.","PeriodicalId":340514,"journal":{"name":"Proceedings of the 14th ACM International Workshop on Context-Oriented Programming and Advanced Modularity","volume":"18 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2022-06-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"132060407","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}