{"title":"On-Demand Layer Activation for Type-Safe Deactivation","authors":"T. Kamina, Tomoyuki Aotani, Atsushi Igarashi","doi":"10.1145/2637066.2637070","DOIUrl":null,"url":null,"abstract":"Dynamic layer deactivation in context-oriented programming (COP) allows a layer to be dynamically disabled in the running application in a disciplined way. Deactivating a layer may lead to an error if there is another layer which has been activated but depends on the deactivated layer in the sense that the latter calls a method that exists only in the former. A type system or static analysis might be able to check the absence of such depending layers at each deactivation point but it would not be very easy, especially in the open-world setting. We argue that the on-demand activation, which implicitly activates all layers on which currently activated layer depends, addresses this problem. In this mechanism, the precedent layer deactivation is canceled when the depending layer requires the implementation of the deactivated layer. This means that this mechanism can ensure that all method calls succeed without performing the checks of absent depending layers, which simplifies the type system. We formalize this idea as an extension of ContextFJ, a COP extension of Featherweight Java, and prove its type soundness.","PeriodicalId":434800,"journal":{"name":"Proceedings of 6th ACM International Workshop on Context-Oriented Programming","volume":"2 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2014-07-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"8","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of 6th ACM International Workshop on Context-Oriented Programming","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2637066.2637070","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 8
Abstract
Dynamic layer deactivation in context-oriented programming (COP) allows a layer to be dynamically disabled in the running application in a disciplined way. Deactivating a layer may lead to an error if there is another layer which has been activated but depends on the deactivated layer in the sense that the latter calls a method that exists only in the former. A type system or static analysis might be able to check the absence of such depending layers at each deactivation point but it would not be very easy, especially in the open-world setting. We argue that the on-demand activation, which implicitly activates all layers on which currently activated layer depends, addresses this problem. In this mechanism, the precedent layer deactivation is canceled when the depending layer requires the implementation of the deactivated layer. This means that this mechanism can ensure that all method calls succeed without performing the checks of absent depending layers, which simplifies the type system. We formalize this idea as an extension of ContextFJ, a COP extension of Featherweight Java, and prove its type soundness.