{"title":"The declarative nature of implicit layer activation","authors":"Stefan Ramson, Jens Lincke, R. Hirschfeld","doi":"10.1145/3117802.3117804","DOIUrl":null,"url":null,"abstract":"Context-oriented programming (cop) directly addresses context variability by providing dedicated language concepts: layers, units of modularity store context-dependent behavior. During runtime, layers can be applied dynamically depending on the current context of the program. Various activation means for layers have been proposed. Most of them require developers to model context switches explicitly. In contrast, implicit layer activation (ila) allows developers to bind the activation status of a layer to a boolean predicate. The associated layer stays automatically active as long as the given predicate evaluates to true. Despite its declarative semantics, ila is usually implemented in an imperative fashion. In this paper, we present and compare two implementation variants for ila in ContextJS: an imperative and a reactive implementation. Furthermore, we discuss their trade-offs regarding code complexity as well as runtime overhead.","PeriodicalId":162398,"journal":{"name":"Proceedings of the 9th ACM International Workshop on Context-Oriented Programming","volume":"63 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2017-06-19","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"7","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 9th ACM International Workshop on Context-Oriented Programming","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3117802.3117804","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 7
Abstract
Context-oriented programming (cop) directly addresses context variability by providing dedicated language concepts: layers, units of modularity store context-dependent behavior. During runtime, layers can be applied dynamically depending on the current context of the program. Various activation means for layers have been proposed. Most of them require developers to model context switches explicitly. In contrast, implicit layer activation (ila) allows developers to bind the activation status of a layer to a boolean predicate. The associated layer stays automatically active as long as the given predicate evaluates to true. Despite its declarative semantics, ila is usually implemented in an imperative fashion. In this paper, we present and compare two implementation variants for ila in ContextJS: an imperative and a reactive implementation. Furthermore, we discuss their trade-offs regarding code complexity as well as runtime overhead.